Skip to content

DST is ignored in parsing of timestamp #8

@toorinl

Description

@toorinl

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'));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions