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 7398991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:56:56+00:00 2026-05-29T03:56:56+00:00

I have a problem with timestamp. Suppose a user uploads a picture somewhere in

  • 0

I have a problem with timestamp. Suppose a user uploads a picture somewhere in USA at 4.30 am and if another user sees this picture in Japan. It would show 4.30 am as the date saved in database would be 4.30 am but it should be 4.30 pm to the Japanese people, as they are 12 hours ahead of America.

So I was thinking to get the current server time using PHP, let’s say it is a and also get the current time of user using JavaScript functions say it is b and then find the difference between b and a and that result should be added to the date stored in the database.

So server may show 4.30 am and js function gives 4.30 pm it would give 12 hrs difference so this 12 hrs should be added to the date saved in the database.This is what I thought of doing but I’m not sure if there are any inbuilt plugins in doing the task because every site will be using this type of feature may be they might be using someone’s open source code.

Also there might be any other better solutions? And is my algorithm right? I was thinking it is little bit time consuming getting the difference and adding those to all the posts would be little time consuming.

  • 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-29T03:56:57+00:00Added an answer on May 29, 2026 at 3:56 am

    Store all time stamps as UTC. Then for the user interface do the correction for the particular time zone for the user. You can also take into account day light savings if necessary

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

Sidebar

Related Questions

I have a problem converting a timestamp in javascript. I have this timestamp: 2011-10-26T12:00:00-04:00
Problem I have timestamped data, which I need to search based on the timestamp
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have a problem extracting the year out of a mysql timestamp field. I
I have problem with this code, it's working on debug environment. On the instruments
I have a problem verifying a SOAP message timestamp and body. Before starting to
I have a problem constructing a mysql query: I have this table tSubscribers were
I have this problem, that usually api entry point works fine: https://www.google.com/analytics/feeds/accounts/default but when
I have a problem which can't solve by myself. Here is timestamp 1308085200 taken
have a problem creating my new table in SqlLite3 I have created this migration

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.