182x Posted July 13, 2007 Share Posted July 13, 2007 Hey guys, I am using the following to display the date/time for the user, however I was wondering is there a way to automate the process of the daylight saving time so that the code does not have to be changed everytime the time changes? Thanks. <?php date_default_timezone_set('GMT+1');echo date('l dS \of F Y h:i:s A'); ?> Quote Link to comment Share on other sites More sharing options...
lococobra Posted July 14, 2007 Share Posted July 14, 2007 Find the month/day using separate date() calls, then use ifs to check if the date is within a DST time zone, if so... adjust the time accordingly and finally build the echo'd string out of a couple other date() calls concatenated with the time stuff you've found. Hmm, complicated enough? Quote Link to comment Share on other sites More sharing options...
182x Posted July 14, 2007 Author Share Posted July 14, 2007 thanks for teh reply when I upload the code to the server I now get thie following error, just wondering how to avoid it? Call to undefined function: date_default_timezone_set() Quote Link to comment Share on other sites More sharing options...
metrostars Posted July 14, 2007 Share Posted July 14, 2007 NVM. Quote Link to comment Share on other sites More sharing options...
182x Posted July 14, 2007 Author Share Posted July 14, 2007 thanks but with that i get this error: Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' Quote Link to comment Share on other sites More sharing options...
182x Posted July 14, 2007 Author Share Posted July 14, 2007 nevermind. Anymore ideas? Quote Link to comment Share on other sites More sharing options...
metrostars Posted July 14, 2007 Share Posted July 14, 2007 What version of phP u using? Quote Link to comment Share on other sites More sharing options...
182x Posted July 14, 2007 Author Share Posted July 14, 2007 5 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.