chris_rulez001 Posted August 16, 2007 Share Posted August 16, 2007 hi, im having problems getting the right time, can someone help? i live in england, so its BST (british summer time) thanks in advance, chris Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/ Share on other sites More sharing options...
plutomed Posted August 16, 2007 Share Posted August 16, 2007 How have you been doing it? Have you been using date(); ? Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326215 Share on other sites More sharing options...
NArc0t1c Posted August 16, 2007 Share Posted August 16, 2007 How do you mean? bool date_default_timezone_set ( string $timezone_identifier ) Example: <?php date_default_timezone_set('BST'); echo date('D-M-Y'); ?> Edit: made life easier. Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326216 Share on other sites More sharing options...
lemmin Posted August 16, 2007 Share Posted August 16, 2007 The date() function simple returns the system time from the machine it is being run on. If the server clock is set to a different time zone that the computer you are accessing it form (and want it to be the same), change the system time zone on the server running the php. Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326218 Share on other sites More sharing options...
NArc0t1c Posted August 16, 2007 Share Posted August 16, 2007 The date() function simple returns the system time from the machine it is being run on. If the server clock is set to a different time zone that the computer you are accessing it form (and want it to be the same), change the system time zone on the server running the php. Just clarifying, date_default_timezone_set — Sets the default timezone used by all date/time functions in a script Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326219 Share on other sites More sharing options...
chris_rulez001 Posted August 16, 2007 Author Share Posted August 16, 2007 How do you mean? bool date_default_timezone_set ( string $timezone_identifier ) Example: <?php date_default_timezone_set('BST'); echo date('D-M-Y'); ?> Edit: made life easier. im getting a: Fatal error: Call to undefined function: date_default_timezone_set() in /home4/thunder/public_html/support/index.php on line 117 Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326222 Share on other sites More sharing options...
NArc0t1c Posted August 16, 2007 Share Posted August 16, 2007 Try: <?php ini_set('date.timezone','BST'); echo dat('Y-M-D); ?> Not to suer about that. Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326226 Share on other sites More sharing options...
chris_rulez001 Posted August 16, 2007 Author Share Posted August 16, 2007 Try: <?php ini_set('date.timezone','BST'); echo dat('Y-M-D); ?> Not to suer about that. ok, thats showing no errors but no time Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326231 Share on other sites More sharing options...
NArc0t1c Posted August 16, 2007 Share Posted August 16, 2007 Sorry, typo. <?php ini_set('date.timezone','BST'); echo date('Y-M-D'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326233 Share on other sites More sharing options...
chris_rulez001 Posted August 16, 2007 Author Share Posted August 16, 2007 Sorry, typo. <?php ini_set('date.timezone','BST'); echo date('Y-M-D'); ?> its showing no time Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326235 Share on other sites More sharing options...
AndyB Posted August 16, 2007 Share Posted August 16, 2007 http://www.php.net/manual/en/function.date-timezone-set.php is only for php 5. Is that what's installed on your server? Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326245 Share on other sites More sharing options...
chris_rulez001 Posted August 16, 2007 Author Share Posted August 16, 2007 php version 4 Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326272 Share on other sites More sharing options...
plutomed Posted August 17, 2007 Share Posted August 17, 2007 Ignore Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326288 Share on other sites More sharing options...
chris_rulez001 Posted August 17, 2007 Author Share Posted August 17, 2007 Ignore ignore what? how can i get php to show the correct time, with the timezone im in? Quote Link to comment https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326594 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.