SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru phantom007's Avatar
    Join Date
    May 2008
    Posts
    741
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Question Managing timezones for different users

    Hi

    I have a website where I have many users coming from different countries. Users can schedule a task based on their timezone. Now there is a cron running on the server after every min, the cron executes a script which checks if there are any scheduled task of any user and if so it does the needful.

    Since my server is based in the US, the script executed by the cron considers the timezone of the US. What do I have to do in my script that will execute the user's task based on user's timezone instead of server's timezone?

    Thanks in advance for any ideas

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,032
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    One way would be to have all tasks scheduled and executed based on UTC and when a user views the tasks the app displays them based on their local time. You might need to get all users to specify their timezone (ie how many hours +/- of GMT (UTC). If the server is already set up to use one of the four US timezones then it's best to do the schedulaing and execution based on that timezone with users specifying what their timezone
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  3. #3
    SitePoint Guru phantom007's Avatar
    Join Date
    May 2008
    Posts
    741
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply

    is there any function in php that will tell me the time difference between the server timezone and the user's timezone?

    For example how much difference in hours is US timezone and Japan timezone?


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
  •