Datetime recorded in UTC on server but to be edited in local time
Datetime recorded in UTC on server but to be edited in local time

in Editor
Hello all,
I cannot figure which pattern I have to follow to manage dates in different timezonew with datatables editor.
This is what I have to do:
- Server stores date and time in UTC
- the client when it connects should display the date time in the client timezone.
I was hoping to use getFormatter and setFormatter to change between timezones but I could not find any example.
Any suggestion would be appreciated.
ty
f
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I don't have any examples of using the formatters to change time zones, but it should be quite possible. You can do it in PHP using the
DateTime
object - see for example this SO thread.Regards,
Allan
Thanks Allan,
I finally solved this way:
This is the code I used. Pretty simple actually.
Looks good - thanks for posting back with your code!
Allan