Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 988167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:36:06+00:00 2026-05-16T05:36:06+00:00

I store all datetime values as unix timestamp. Registered users can set personal GMT

  • 0

I store all datetime values as unix timestamp. Registered users can set personal GMT locale in their profile. What should I do to display all datetime on website in user’s GMT locale?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T05:36:07+00:00Added an answer on May 16, 2026 at 5:36 am

    There’s no such thing as “user’s GMT locale”. You must be referring to the user’s timezone.

    You can convert unix timestamps to dates in the user timezone this way:

    $timestamp = ...;
    $tz = new DateTimezone("Europe/Lisbon"); //substitute by the user's timezone
    $d = new DateTime("@$timestamp");
    $d->setTimezone($d);
    echo $d->format(DateTime::RFC822);
    

    If you only have a GMT offset, you can use:

    $tz = new DateTimezone("Etc/GMT-12");
    

    Note, however, that if you use GMT offsets, you will have to change them when the users enter or leave daylight saving time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multi-timezone web application that stores all of the datetime values in
First of all, let's define a few tables: Users table will store information about
I normally store all my configs in the registry. Even though I have started
We have a requirement in project to store all the revisions(Change History) for the
Is there any way to make Visual Studio 2008 Express store all the files
I have a properties file in java, in which I store all information of
Quicktime has a rich metadata API, allowing one to store all sorts of arbitrary
I have problem with return statment >.< I want to store all magazine names
If all of my __init__.py files are empty, do I have to store them
The title pretty much says it all. I'm using a TClientDataset to store an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.