Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Web Design (WordPress, Joomla, etc.) clock displaying Pacific Daylight Time

  • clock displaying Pacific Daylight Time

    Posted by Stef Prein on May 8, 2008 at 7:35 pm

    For an internship in San Francisco, I’m moving from The Netherlands to California. I would like to display the PDT on my website. Does anyone know a JavaScript to do this?
    Thanks in advance!

    Stef Prein replied 18 years ago 2 Members · 2 Replies
  • 2 Replies
  • Curtis Thompson

    May 9, 2008 at 5:37 am

    hello…

    this is a slightly tricky thing to do in javascript, but certainly doable – here’s a script that will get you started:

    https://www.javascriptworld.com/chap13-4.html

    basically the concept is that you get utc (gmt) time and you subtract a specific amount of hours from it and then you have the time in that zone – that part is relatively easy, so the trickiness comes in making sure that you adjust for dst and the likes. i found the above script as an example and it will get you started, but just keep an eye on anything you do come this fall – or do research time zones in javascript, as it is relatively simple to write a function that determines if you are in dst or not and adjust clocks accordingly…

    lemme know if you have additional questions!

    sitruc

  • Stef Prein

    May 12, 2008 at 4:09 pm

    Hi Curtis,
    Thanks for your help! I’ll check it out!
    Cheers,
    Stef

    Stuffy
    student
    Image and Media Technology
    Utrecht School of the Arts
    The Netherlands
    http://www.stefprein.com

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy