-
Notifications
You must be signed in to change notification settings - Fork 185
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
support Date.toString()
format
#148
Comments
hi cory, whoa, this looks like a bug. you're right though. I think the |
fwiw, this date format seems to be supported, if it helps: |
It's the JS string output of a new Date(
String(
new Date(2020, 1, 1)
)
) (if anyone is reading this and shaking your head at trying to use a JS date string like this then please correct me) I'm somewhat new to JS dates and have been throwing everything at libs. I just recently found out UTC Everything!!! is a thing. Just thought this was weird behavior... I reckon you use |
hahaha |
just reading about this, it seems it's well-documented here, for future-me. not sure how this should relate to the informal-timezone parsing stuff. I think we could get-away with ignoring the los angeles stuff, and just setting it to |
GMT-0700
Date.toString()
format
Date.toString()
formatDate.toString()
format
another note to myself:
we should just loop around a ton of dates, and input->output, and make sure the Date objects are the same. There's bound to be a bunch of gotchas. |
I'd definitely use IANA timezone names instead of +/- hour offsets. There is a ton of data associated with these that shouldn't be ignored. https://medium.com/@toastui/handling-time-zone-in-javascript-547e67aa842d grep IANA |
I suspect 99.999% of datetime use cases should be:
Every single other pattern seems to touch I hate datetimes. :( Curious what your thoughts are on that pattern ^ |
yep, I think you're right. it took me a long time to come to your conclusion, about how yeah, because the calendar changes on a political basis, a time string means whenever that time will be.... So, like you said, you need UTC calendar info, and a iana zone. Unfortunately iso dates don't usually have a IANA zone. I think most solutions involve setting a iana in a user table and making some (usually correct) assumptions. also, IMO it doesn't matter the details about when/where the date was made, and what the offsets looked like at that time. If i say 'lets meet a year from now' and the politicians change the dst around, we're gonna meet 'less than a year from now', or whatever. That's just my opinion though. hope that helps. |
there's plenty of cranky blog posts out there, without real advice, but I'd say most people end up storing an ISO string, then write edge-cases for any weird if users travel to another timezone, they expect confusion. It's really a UX issue, more than an engineering one. when engineers are launching missles or something, they do a organization-level ad-hoc management solution. There's not a real standard. |
I had to start getting the client's IANA with https://www.npmjs.com/package/jstz :D But yeah I 100% agree with your rant (and all the blog post rants) on how bad time stuff is. |
It seems
goto
just changes the location of the timezone but doesn't keep the moment. It just returns the current time in that timezone...?The text was updated successfully, but these errors were encountered: