Jump to content

Server time +8 hours?


woolyg

Recommended Posts

Hi all,

 

I'm inputting a DATETIME timestamp of $now into my table

 

<?
$now = date("Y-m-d H:i:s");
?>

- which enters the exact time of update into the table. The problem is, is that I'm in Dublin (GMT) and the hosting server is in the US - 7 hours behind - so if I entered data at exactly midday in dublin, the value displayed is 5am.

Can someone guide me as to how I can alter the variable [b]$now[/b] to show Dublin time?

Any help appreciated,
Woolyg

Link to comment
Share on other sites

..so if I use the setlocale function at the start of a page, my '$now' declaration will return Dublin time?

 

Does the following work, or would I need to follow GB for GMT?

<?php
/* Set locale to Ireland */
setlocale(LC_ALL, 'ie_IE');
?>

 

Thanks,

Woolyg

 

Link to comment
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.