-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
automatic date parsing ... is this really good? #11
Comments
It seems like you're requesting a feature be removed or disabled because it requires the developer to store dates with specific timezones? Perhaps another example would be in order, but I'm not understanding how this could be an issue unless the developer required timezone information but didn't store it? Example:
this produces
So...either the consumer of node-postgres will have to know "Hey, I get local dates back if I don't specify a timezone. I have to adjust the date objects to the timezone I want to use." or will have to know "Hey, I get difficult to parse date strings back in a non-specific timezone and have to convert them to a date object and then ajust the date objects to the timezone I want to use." Seems like it would place more burden on the developer while not removing any. But like I said...perhaps I am missing something. |
What will be output if you remove conversion to "text" type in sql? |
* Add callback interface to pool#query * Fix linting errors
At some point it can be good to convert timestamp values to natural Date javascript objects, but currently it will bring problems more than joy.
Easier is to bring example than describe it:
Will output:
{
"d1": "2011-01-21T22:59:45.424Z",
"d2": "2011-01-22T00:59:45.000Z",
"t": "2011-01-22 00:59:45.424245+02"
}
1295650785424
1295657985000
Sat Jan 22 2011 00:59:45 GMT+0200 (EET)
Sat Jan 22 2011 02:59:45 GMT+0200 (EET)
2011-01-22 00:59:45.424245+02
As you can see -- time can change depending in what timezone you are.
Don't get me wrong -- I really like this feature but I put system in live without checking enough and ... boom :)
I think using Date object should be configurable and default should be off (and should be very clearly documentated).
Or turned on ONLY with timestamps with timezones but then it is confusing for user.
The text was updated successfully, but these errors were encountered: