Skip to content
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

DST is ignored in parsing of timestamp #8

Open
toorinl opened this issue Dec 5, 2017 · 0 comments
Open

DST is ignored in parsing of timestamp #8

toorinl opened this issue Dec 5, 2017 · 0 comments

Comments

@toorinl
Copy link

toorinl commented Dec 5, 2017

If a timestamp is in daylight saving time, but the process is not, then a difference of 1 hour is recorded. DST is indicated with an S and normal time with a W. Below the quote from the specs and below that a suggestion on how to solve the issue.

ASCII presentation of Time stamp with Year, Month, Day, Hour, Minute, Second, and an indication whether DST is active (X=S) or DST is not active (X=W).

var parsedTimestamp = new Date("20"+timestamp.substring(0, 2)+' '+ timestamp.substring(2, 4)+ ' ' + timestamp.substring(4, 6)+ ' ' + timestamp.substring(6, 8)+ ':' + timestamp.substring(8, 10)+':' + timestamp.substring(10, 12)+ (timestamp.substring(12, 13)=='W' ? ' +1':' +2'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant