halestorm Posted April 15, 2007 Share Posted April 15, 2007 Does anyone know if there is a PHP solution to put the current day/date into a webpage? I have found ways to do it with Javascript but in IE it always 'blocks' scripts. I would like the output to say the month/day/year It may be a simple request - I am fairly new to PHP. Thanks... Link to comment https://forums.phpfreaks.com/topic/47154-timestamp-for-websites/ Share on other sites More sharing options...
Voldemort Posted April 15, 2007 Share Posted April 15, 2007 <?php // Without leading zeros // ex. 3/28/2002 echo date('n/j/Y'); // With leading zeros // ex. 04/15/2002 echo date('m/d/Y'); ?> Link to comment https://forums.phpfreaks.com/topic/47154-timestamp-for-websites/#findComment-229952 Share on other sites More sharing options...
halestorm Posted April 16, 2007 Author Share Posted April 16, 2007 OK. Perfect. Now is there a way to format that output to be something like April 16, 2007? I am assuming it would link the numbers 1,2,3 to the months Jan, Feb, March... Again. Thanks for the help. Link to comment https://forums.phpfreaks.com/topic/47154-timestamp-for-websites/#findComment-230074 Share on other sites More sharing options...
rcorlew Posted April 16, 2007 Share Posted April 16, 2007 echo date('M j, Y'); Link to comment https://forums.phpfreaks.com/topic/47154-timestamp-for-websites/#findComment-230087 Share on other sites More sharing options...
bsprogs Posted April 16, 2007 Share Posted April 16, 2007 Here is a reference you may want to check out. It basically gives you all the options you have for formatting the dates http://php.net/date Link to comment https://forums.phpfreaks.com/topic/47154-timestamp-for-websites/#findComment-230089 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.