You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have bump into a terrible trap today. I think maybe I should blame why Chrome is so clever.
I need to translate a date string to a date object in my code. At first I get the date string like this: 2017-08-03 18:30:00.
'Easy job', I think. So I write like this.
constdate=newDate('2017-08-03 18:30:00')
It run well in Chrome.
But failed in safari.
Why? Because it's an illegal date string. In IETF-compliant RFC 2822 timestamps, it stipulates that we should add T to indicate the beginning of time string.
T “T” appears literally in the string, to indicate the beginning of the time element.
I have bump into a terrible trap today. I think maybe I should blame why Chrome is so clever.
I need to translate a date string to a date object in my code. At first I get the date string like this:
2017-08-03 18:30:00
.'Easy job', I think. So I write like this.
It run well in Chrome.
But failed in safari.
Why? Because it's an illegal date string. In IETF-compliant RFC 2822 timestamps, it stipulates that we should add T to indicate the beginning of time string.
So I change it to legal date string.
But? What ?? What's wrong with the timezone.
However, as we do not offer the timezone, it's correct for the browser to consider it as universal time. So, we should declare the timezone.
hmmm. bugfix.
The text was updated successfully, but these errors were encountered: