Ostico / PhpOrient

PhpOrient - Official Php driver based on the binary protocol of OrientDB.
Other
68 stars 37 forks source link

how can in fix Timezone of date #54

Closed jackraj88 closed 8 years ago

jackraj88 commented 8 years ago

Hi, i am using odb - 1.7.11, phporient - 1.0

In database inserted record Asia/kolkata timezone but using ostico phporient driver retrieve record from database timezone will be differ. how can i fix it.

smolinari commented 8 years ago

Since ODB doesn't have a clue about time zones, I believe you have to account for timezone differences in your application. Basically, you'd need to save the time according to UTC, then recalculate the time according to the user's own time zone.

http://orientdb.com/docs/2.1/Managing-Dates.html

https://en.wikipedia.org/wiki/Coordinated_Universal_Time

Scott

andreyvk commented 8 years ago

I would usually set server's timezone to UTC so that I know how to quickly convert from saved date into a date displayed to a client

On Mon, Nov 2, 2015 at 1:09 PM, Scott notifications@github.com wrote:

I believe you have to account for timezone differences in your application. Basically, you'd need to save the time according to UTC, then recalculate the time according to the user's own time zone.

— Reply to this email directly or view it on GitHub https://github.com/Ostico/PhpOrient/issues/54#issuecomment-152938920.

smolinari commented 8 years ago

Right. That is what I also meant. LOL! Obviously, the clock you get the current time from to save would also need to be set to UTC. :smile:

Scott

Ostico commented 8 years ago

Thank you @andreyvk and @smolinari for support. I close.

andreyvk commented 8 years ago

Anytime @Ostico! ))