Results 1 to 7 of 7

Thread: Local time doesn't shift timezone

  1. #1
    Join Date
    Nov 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Local time doesn't shift timezone

    1) Script Title: Local Time script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex6/localtime.htm

    3) Describe problem:
    I cannot seem to get the script to work at all in Firefox, and in Safari it doesn't display the shifted timezones.

    I've copied the code almost verbatim from DD. See it in action here:
    http://tinyurl.com/yl8477

    Prints in Safari:
    All of them show the same time, despite having different variables.

    Prints in Firefox:
    Server Time: NaN:NaN:NaN AM (undefined)

    Thanks.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    I see two problems here. Firstly, the script in the HEAD section of your page do not match the original version in some lines. Not sure why, but just recopy the script to your page to fix that issue.

    Secondly, are you sure your page is properly configured to run PHP? Does this line of code below when added to your page displays the current server time:

    Code:
    <? print date("F d, Y H:i:s", time())?>

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    PHP should start with <?php .......... ?>, not <?...

    That might be valid too. Not sure...
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    It shouldn't make a difference on most servers, no.

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Alright. Wasn't sure.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin
    Quote Originally Posted by djr33
    PHP should start with <?php .......... ?>, not <?...
    It shouldn't make a difference on most servers, no.
    He's still right though: it should start "<?php". That is always correct and always parsed properly. The shorter forms - <?, <?=, <% - only work if the server is configured to allow them, and the recommended PHP configuration disables them.

    Mike

  7. #7
    Join Date
    Nov 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    same problems here... i copied the code without making any changes ang i get NaN.

    btw, i use ie to browse and wamp5.

    thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •