My own server
My Home page
Sign Guestbook
Read Guestbook
The Apache manual
The PHP manual
PHP examples (Core PHP Progr.)
PHP examples (Pro. PHP Progr.)
My own PHP exemples

PHP-test 4

Test of different date and time formats


Code: <? print(date("Y-m-d H:i:s")); ?>
Result: 2003-08-31 12:15:19
 
Code: <? print( gmdate("Y-m-d H:i:s", getlastmod() ) . " GMT"); ?>
Result: 2003-08-31 09:54:50 GMT
 
Code: <? print(date("Y-m-d H:i:s", getlastmod() )); ?>
Result: 2003-08-31 11:54:50
 
Code: <? print (date ("l dS of F Y h:i:s A", getlastmod() )); ?>
Result: Sunday 31st of August 2003 11:54:50 AM
 
Code: <? $theDate = mktime(0,0,0,6,25,1986);
print ( date("F jS, Y", $theDate) . " was on a " . date("l", $theDate) ); ?>
Result: June 25th, 1986 was on a Wednesday
 
Code: <? $jdc = gregoriantojd(4,12,1961);
print ( jdtogregorian($jdc) . " (Gagarin's space flight!) was on ");
print ( jdtojulian($jdc) . " in the julian calendar"); ?>
Result: 4/12/1961 (Gagarin's space flight!) was on 3/30/1961 in the julian calendar

How does it look?
Page created 2000-07-25, last changed 2003-08-31 11:54
This mirror page last changed 2009-12-04

© 2003 Bo Johansson