Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Hi,
As far as I see when I store a DateAndTime with local time, "2017-03-31T17:10:46.137086+02:00", then I fetch it back, I got an UTC DateAndTime "2017-03-31T15:10:46.137086+00:00". Am I doing something wrong or do I need to use a mongo description to correct that. But wait, even so, I will not know what was the initial local time. How do you usually deal such issue? Thanks Hilaire -- Dr. Geo http://drgeo.eu |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Hi,
> Am 31.03.2017 um 17:16 schrieb Hilaire <[hidden email]>: > > Hi, > > As far as I see when I store a DateAndTime with local time, > "2017-03-31T17:10:46.137086+02:00", then I fetch it back, I got an UTC > DateAndTime "2017-03-31T15:10:46.137086+00:00". > > Am I doing something wrong or do I need to use a mongo description to > correct that. But wait, even so, I will not know what was the initial > local time. > > How do you usually deal such issue? > I think we shouldn't store DateAndTime as BSON date. We should create a custom type that includes timezone offset information. Norbert |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Or just store as ISO8601 string.
... [show rest of quote]
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Thanks for the idea.
For me it is a bug[2], like the other one related to Date persistency, saved as DateAndTime, then shifting you one day[1]. Hilaire [1] https://github.com/pharo-nosql/voyage/issues/88 [2] https://github.com/pharo-nosql/voyage/issues/89 Le 31/03/2017 à 18:54, Paul DeBruicker a écrit : > Or just store as ISO8601 string. > -- Dr. Geo http://drgeo.eu |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Based on the Paul suggestion, one can write a description to get
DateAndTime right. Hopefully this could be fixed in Voyage Hilarie mongoAccesstime <mongoDescription> ^ VOToOneDescription new attributeName: 'accessTime'; accessor: (MAPluggableAccessor read: [:userClient| userClient accessTime printString] write: [:userClient :string | userClient accessTime: (DateAndTime fromString: string)]); yourself Le 31/03/2017 à 21:06, Hilaire a écrit : > Thanks for the idea. > For me it is a bug[2], like the other one related to Date persistency, > saved as DateAndTime, then shifting you one day[1]. -- Dr. Geo http://drgeo.eu |
Free forum by Nabble | Edit this page |