The time () function is a built-in function in PHP . time() returns the current time measured in the number of seconds since the Unix Epoch. The number of seconds can be converted to the current date using date () function in PHP.
<?php
$t=time();
echo($t . "<br>");
echo(date("Y-m-d",$t));
?>
Output
1624962270
2021-06-29
The MySQL NOW() function returns the current date and time in the configured time zone as a string or a number in the 'YYYY-MM-DD HH:MM:DD' format. The returned type of the NOW() function depends on the context where it is used. For example, in the following statement, the NOW() function returns the current date and time as a string.
select now();
output
No comments:
Post a Comment