Displaying current time
We can display current time by using time() function. Here is the code
date(" H:i:s", time());
The output is here 10:56:40
Format for MySQL datetime field
MySQL datetime field stores date with time. Here is the format required to store data in this field.
$tdtp=date("Y-m-d H:i:s",time());
Here is the output : 2025-05-03 10:56:40


No comments:
Post a Comment