3 Replies - 458 Views - Last Post: 25 February 2013 - 10:24 AM Rate Topic: -----

#1 cartman182  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 22
  • Joined: 19-May 12

Local and Client time?

Posted 22 February 2013 - 03:04 PM

Hi

I was wondering if it possible to get the Servers Local Time with some kind of function.For some reason I only get really old code on the topic which uses an alternate kind of a guessing method.
So if I am sitting in Canada I want to see the Servers Local time in America if the server running the PHP is in America.

I tried the old code but it was way off.
Is This A Good Question/Topic? 0
  • +

Replies To: Local and Client time?

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6058
  • View blog
  • Posts: 23,496
  • Joined: 23-August 08

Re: Local and Client time?

Posted 22 February 2013 - 03:36 PM

date('c') retrieves the date on the server, in the server's configured time zone.
Was This Post Helpful? 0
  • +
  • -

#3 cartman182  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 22
  • Joined: 19-May 12

Re: Local and Client time?

Posted 24 February 2013 - 07:15 AM

Ahh ok awesome.

And client timezone?
Was This Post Helpful? 0
  • +
  • -

#4 laytonsdad  Icon User is online

  • Cheese and Sprinkles
  • member icon

Reputation: 436
  • View blog
  • Posts: 1,851
  • Joined: 30-April 10

Re: Local and Client time?

Posted 25 February 2013 - 10:24 AM

View Postcartman182, on 24 February 2013 - 07:15 AM, said:

Ahh ok awesome.

And client timezone?

Javascript:

var offset = new Date().getTimezoneOffset();
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1