Display Date and Time in PHP
Advertisements
Display Date and Time in PHP
Using now() function you can get current data and time and store it into database but first choose column name date and time because now() now work with date datatype.
Display today date and time on webpage using PHP
<?php $mydate=getdate(date("U")); echo "$mydate[weekday], $mydate[month] $mydate[mday], $mydate[year]"; ?>
Live Demo
Monday, November 25, 2024
Insert today date in database
Insert system date and time in database using mysql
<?php $sql = "insert into user(f_name, l_name, date) VALUES('$f_name', '$l_name', now())"; $result = mysql_query($sql); ?>
Google Advertisment