Display Date and Time in PHP


Prev Tutorial Next Tutorial

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

Friday, November 16, 2018

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);
?>

Prev Tutorial Next Tutorial

Google Advertisements
Download Projects

Google Adsense Advertisements

Buy 3 Year Old Domain, Tutorialday.com, SeosmoTools.com @$200

Buy This Ad Space @$50 per Month, Ad Size 300X250 Contact on: hitesh.xc@gmail.com WhatsApp no. 8882538826

Yahoo Advertisements