0

I have read a lot of articles about best way to store user's datetime. Here is a good one. The article suggests to store datetime in two seperate column one is for UTC datetime and another is for local datetime and another column for the local timezone. If i understood correctly the local date time referred to the user's/client's date time and timezone. Now i know i can save the UTC date time using UTC_TIMESTAMP(). But how do i save the local datetime and timezone using php? I need a direction here.

Bipul Roy
  • 506
  • 2
  • 7
  • 18
  • Save the time as a unix timestamp (timezone independent) and then use the proper code to display the time to the user formatted as desired. – Jared C Jan 11 '19 at 06:48
  • I want to go with the `DATETIME` and how do i store local `DATETIME` and also the timezone??? – Bipul Roy Jan 11 '19 at 06:52

1 Answers1

1

Maybe this would be helpful for you Possible duplicate get local user time instead of server
Moreover, you can fetch local date time using javascript ajax call to server.