webgyrl Posted July 5, 2004 Share Posted July 5, 2004 Does anyone know where I might be able to get a Date Script that displays like the one on this site www.recording.org See the left hand side where it shows date in this format: July 5, 2004 If anyone knows of a script that shows the date in this format that also has the time, I'd appreciate a link. I've been browsing HotScripts but haven't found exactly this format yet. Thanks, Nat Quote Link to comment Share on other sites More sharing options...
hindixp Posted July 5, 2004 Share Posted July 5, 2004 try these, http://www.dynamicdrive.com/dynamicindex6/clock3.htm Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted July 5, 2004 Share Posted July 5, 2004 You can do it with PHP simply enough. <?php $today = date("F j, Y"); echo " $today"; ?> Quote Link to comment Share on other sites More sharing options...
TCH-Don Posted July 5, 2004 Share Posted July 5, 2004 For more info on formatting php date() see http://us2.php.net/manual/en/function.date.php Quote Link to comment Share on other sites More sharing options...
webgyrl Posted July 14, 2004 Author Share Posted July 14, 2004 Thanks guys! Nat Quote Link to comment Share on other sites More sharing options...
webgyrl Posted February 24, 2006 Author Share Posted February 24, 2006 (edited) Hey guys, I just did this for a new site I am working on, and for some reason the date and time are not showing on the page. The code I used is as follows: ><?php echo date("F d, Y @ g:i:s A"); ?> Any reason this would not show up. Check page here: http://www.sanctuarylane.com/ dttest.htm (remove space) Weird. Did I miss a step? Do I need to upload some other script or something? All I did was put this PHP code in the body. Edited February 24, 2006 by webgyrl Quote Link to comment Share on other sites More sharing options...
TCH-Thomas Posted February 24, 2006 Share Posted February 24, 2006 Hi Nat, I am not the best with php, but have a look at this page and see which one that looks most similar to what you are trying and see what you might have done wrong. Quote Link to comment Share on other sites More sharing options...
TCH-Don Posted February 24, 2006 Share Posted February 24, 2006 You are using a .htm page you need to use a .php page for the php code to be parsed or put the folloing in your .htaccess file. AddType application/x-httpd-php .htm .html then all your .htm and .html pages will be parsed for php code this is what I do. Quote Link to comment Share on other sites More sharing options...
wampthing Posted February 24, 2006 Share Posted February 24, 2006 Way cool logo on your homepge. I love it. Quote Link to comment Share on other sites More sharing options...
webgyrl Posted March 1, 2006 Author Share Posted March 1, 2006 Hi Don! That worked! I forgot about changing the htaccess file! For some reason the time is reading 2 hours off. I am not sure why that is. Shouldn't the time sych to the users computer? I've got it here now: http://www.sanctuarylane.com/ index1.htm The site isn't done yet.... just getting content etc. Also have this weird thing going on in Firefox where it is showing the slice name "sls_layout" between the Gear and Resources buttons. Can't for the life of me figure out why this is so. It is not appearing in IE. I sliced this and exported it to DW using Fireworks. Really strange! wampthing Thank you kindly! Quote Link to comment Share on other sites More sharing options...
webgyrl Posted March 1, 2006 Author Share Posted March 1, 2006 Oh goodness gracious... OK I see a bunch of stuff on that PHP primer about DST and time zones and I totally forgot about that. How in the heck would I re-write what I have to reflect Eastern US Time... I think we are DST right now.... ><?php echo date("F d, Y @ g:i A"); ?> How do I change this? Why do I always do these things while exhausted? LOL Quote Link to comment Share on other sites More sharing options...
TCH-Andy Posted March 1, 2006 Share Posted March 1, 2006 Hi Nat, Try <?phpecho date("F d, Y @ g:i A Z-18000"); ?> Or you can use the putenv("TZ=required_timzone") Quote Link to comment Share on other sites More sharing options...
TCH-JimE Posted March 1, 2006 Share Posted March 1, 2006 Webgrl, Ok so this is a copy and paste, but it does the job! ><?php // melbdate.php3 // rename file extension from .txt to .php3 // or to .php (updated April 2003) // Script copyright (C) 2000 Dean Kennedy, Terrabyte Communications // Version 1.02 06 November 2003 // Free to use, modify and copy so long as you leave the above // two lines in comments. You can safely delete all other comments // and just leave the four line script // Distributed under the terms of the GNU General Public License (GPL). // Because it is licensed free of charge, there is NO WARRANTY, it is // provided AS IS. The author can not be held liable for any damage that // might arise from the use of this software. Use it at your own risk. // http://www.gnu.org/copyleft/gpl.html // To adjust the format of the date, see the list of variables at the // official PHP site (php.net): http://www.php.net/manual/function.date.php // // If your local time is *behind* the server time, then change the "+" to // a "-" in the $melbdate line // // Keep in mind that you'll have to update the $hourdiff variable within the // script when your *local* daylight saving time/standard time changes, if // it is a different setting to the server daylight saving/standard time // Variable for hours $hourdiff = "14"; // hours difference between server time and local time // If you don't know how many hours, then "uncomment" the three lines // below by deleting "// " to see what the server time is (remember to // put the comments "// " back when you've finished checking: // $serverdate = date("l, d F Y h:i a"); // print ("$serverdate"); // print (" <p>"); // Nothing needs to be changed below here unless you want to change // the format of the date (see above for URL of options) or your local // time is behind the server time $timeadjust = ($hourdiff * 60 * 60); $melbdate = date("l, d F Y h:i a",time() + $timeadjust); print ("$melbdate"); ?> Quote Link to comment Share on other sites More sharing options...
webgyrl Posted March 1, 2006 Author Share Posted March 1, 2006 Hi Nat, Try Or you can use the putenv("TZ=required_timzone") Andy: the reuslt I get is this: March 01, 2006 @ 3:03 PM -25200-18000 I really haven't done enough readying to output the time right. I will have to get to that... geez there are not enough hours in the day for me these days. LOL I'm just doing this site as a favor to a friend, so if I can't get that time right, then I will just leave it out, cuz I have not got a zillion hours to figure it out. But I really want to at least try... but that PHP stuff is confusing to me most times! Quote Link to comment Share on other sites More sharing options...
webgyrl Posted March 1, 2006 Author Share Posted March 1, 2006 (edited) Webgrl, Ok so this is a copy and paste, but it does the job! ><?php // melbdate.php3 // rename file extension from .txt to .php3 // or to .php (updated April 2003) // Script copyright (C) 2000 Dean Kennedy, Terrabyte Communications // Version 1.02 06 November 2003 // Free to use, modify and copy so long as you leave the above // two lines in comments. You can safely delete all other comments // and just leave the four line script // Distributed under the terms of the GNU General Public License (GPL). // Because it is licensed free of charge, there is NO WARRANTY, it is // provided AS IS. The author can not be held liable for any damage that // might arise from the use of this software. Use it at your own risk. // http://www.gnu.org/copyleft/gpl.html // To adjust the format of the date, see the list of variables at the // official PHP site (php.net): http://www.php.net/manual/function.date.php // // If your local time is *behind* the server time, then change the "+" to // a "-" in the $melbdate line // // Keep in mind that you'll have to update the $hourdiff variable within the // script when your *local* daylight saving time/standard time changes, if // it is a different setting to the server daylight saving/standard time // Variable for hours $hourdiff = "14"; // hours difference between server time and local time // If you don't know how many hours, then "uncomment" the three lines // below by deleting "// " to see what the server time is (remember to // put the comments "// " back when you've finished checking: // $serverdate = date("l, d F Y h:i a"); // print ("$serverdate"); // print (" <p>"); // Nothing needs to be changed below here unless you want to change // the format of the date (see above for URL of options) or your local // time is behind the server time $timeadjust = ($hourdiff * 60 * 60); $melbdate = date("l, d F Y h:i a",time() + $timeadjust); print ("$melbdate"); ?> Thanks Jim, I will try this as well. Do I have to create a php3 file to work this? Sorry, it's confusing me a bit. I really thought I could do this with a few simple lines of code Edited March 1, 2006 by webgyrl Quote Link to comment Share on other sites More sharing options...
TCH-Don Posted March 1, 2006 Share Posted March 1, 2006 You can use .php or in your case .html Quote Link to comment Share on other sites More sharing options...
webgyrl Posted March 1, 2006 Author Share Posted March 1, 2006 You can use .php or in your case .html OK... I think there are more detailed instructions... gotta find out what the code is to use to point to the script. Will do that later... having CSS stylesheet debugging session right now! LOL Thanks for the help guys! Quote Link to comment Share on other sites More sharing options...
TCH-Andy Posted March 1, 2006 Share Posted March 1, 2006 Nat, I've just tried the code ><?php echo date("F d, Y @ g:i A T"); echo "<br/>"; putenv("TZ=MST"); echo date("F d, Y @ g:i A T"); echo "<br/>"; putenv("TZ=GMT"); echo date("F d, Y @ g:i A T"); ?> And that gives me March 01, 2006 @ 6:03 PM ESTMarch 01, 2006 @ 4:03 PM MST March 01, 2006 @ 11:03 PM GMT If that helps Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.