Jump to content

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326219
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/65321-time-problems/#findComment-326222
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.