Skip to content

Timezone is being ignored for datetimes #675

Closed

Description

@mnboos

Hi

I'm currently having the problem, that values of type datetime2 are returned as UTC, but the actual value has an offset of 1 hour (our timezone is Europe/Vienna (i.e. +1h)).

The value in the database is 2017-09-12T10:33:00.190 in timezone +1 (i.e. UTC time would be 2017-09-12T09:33:00.190.
However, tedious actually returns 2017-09-12T10:33:00.190Z which is 2017-09-12T11:33:00.190 in local time and that's wrong.

Either I'm wrong and there is some misunderstanding, or there is a problem in the driver.

We're using MSSQL2012 and Tedious 7.4

Activity

  1. sharpart555 commented on Jan 23, 2018

    @sharpart555

    I have same problem too.

    I 'm using MSSQL 2012 and node-mssql 4.1.0

  2. joshstevens19 commented on Apr 16, 2018

    @joshstevens19

    is this still a ongoing issue? i can take a look if so..

  3. leeahoward commented on Jun 14, 2018

    @leeahoward

    Was having the same issue. Seems to be fixed by setting useUTC option.
    options.useUTC
    A boolean determining whether to pass time values in UTC or local time. (default: true).

  4. Suraiya-Hameed commented on Jul 19, 2018

    @Suraiya-Hameed
    Member

    @mnboos @sharpart555 Setting useUTC: false as mentioned by @leeahoward should do the trick. Feel free to reopen the issue if it didn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions