how can i add Uk and india both time zone in same page?

Discussion in 'JavaScript' started by i_am_dhaval, Sep 23, 2009.

  1. #1
    how can i add Uk and india both time zone in same page?

    using java script
     
    i_am_dhaval, Sep 23, 2009 IP
  2. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #2
    you need a geolocation javascript to get the country and time offset. something like what yahoo's geoloc api provides may work...

    then you need some rudimentary javascript functions that deal with formatting date / timestamps and outputting them on-screen.

    here is something i quickly put together that shows me my local time, GMT and time under IST (using mootools framework)

    http://fragged.org/dev/timezone.php

    According to your PC clock, your timezone is:
    GMT, you PC time is Fri Sep 25 2009 14:03:49 GMT+0100 (GMT Daylight Time),
    offset from GMT: +0100
    GMT is now Fri Sep 25 2009 13:03:49 GMT+0100 (GMT Daylight Time)
    IST is now Fri Sep 25 2009 18:33:49 GMT+0100 (GMT Daylight Time)
    
    
    According to your geolocation from yahoo's APIs:
    GB
    United Kingdom
    51.5
    -0.11670000106096
    Europe/London
    1.0
    0.0
    0.0
    2009-09-25 14:02
    
    PHP:
    this does 2 lookups, local pc clock and based upon geolocation for coordinates (once again, my own but it can be tweaked).

    good luck anyway
     
    dimitar christoff, Sep 25, 2009 IP
  3. MaceWin

    MaceWin Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can download a GEO IP database from Maxmind for free as well (though using Yahoo's API is good as well)
     
    MaceWin, Sep 26, 2009 IP
  4. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #4
    dimitar christoff, Sep 26, 2009 IP
  5. weissbrand

    weissbrand Peon

    Messages:
    56
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi, i was searching everywhere.
    I want my blog (wordpress) to show in German for german-speaking visitors (Austria,Germany, Switzerland) but in English for the rest of the world.

    I have know idea how this can be done.

    Are there any tutorials for newbies from scratch?

    Searching my ass off...
    thx
     
    weissbrand, Nov 21, 2009 IP
  6. sunny61162

    sunny61162 Peon

    Messages:
    102
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    yep,

    look:
    if you trying to add uk and india time zone in same page you can use many application based on geological java scripts software search through googgle search engine.:)

    thanks:)
    sunny
     
    sunny61162, Nov 21, 2009 IP