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, May 24, 2019

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

Yahoo Advertisements

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

Buy This Ad Space @$50 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com

Download Projects

Adsense Advertisements
Free Classified Site – Bedpage

Yahoo Ads Advertisements