Jump to content
xisto Community
Sign in to follow this  
Unholy Prayer

Show The Current Date/time With Php

Recommended Posts

<?php$date = date([b]F j, o[/b]); //Displays April 25, 2007 (Assuming that is the current date)$time = date([b]g:i a[/b]);  //Displays 4:26 PM (Assuming that is the current time)echo "Welcome!  The date is $date and the time is currently $time.";?>

You can change the date and time formats by changing the text in bold above. For a complete list of time formats, visit the link below.
http://us2.php.net/manual/en/function.date.php

Share this post


Link to post
Share on other sites
<?php$date = date("F j, o"); //Displays April 25, 2007 (Assuming that is the current date)$time = date("h:i s");  //Displays 4:26 PM (Assuming that is the current time)$time_now=mktime(date('h')+5,date('i')+30,date('s'));$datetime=date('h:i:s',$time_now);echo "Welcome!  The date is [b]<b>[/b] $date [b]</b[/b]> and the time is currently [b]<b>[/b]$datetime[b]</b>[/b].";?>
Edited by moderator (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.