Skip to content

Geolocation extension datetime returns value converted to local timezone of server. #718

Closed

Description

@itg-assistant

Ser Gar asked 2017-03-23 05:13:37 UTC

Hi, from geolocation extension sourcecode:
long milliseconds = position.timestamp;
this.TimeStamp = new DateTime(minTicks, DateTimeKind.Utc).AddMilliseconds(milliseconds).ToLocalTime();

If server is hosted in another timezone, client js UTC timestamp is converted to a local server time,
I guess geolocation datetime in wisej must be showed as UTC
Maybe like this (without "ToLocalTime()" method):

long milliseconds = position.timestamp;
this.TimeStamp = new DateTime(minTicks, DateTimeKind.Utc).AddMilliseconds(milliseconds)

Or better solution to have 2 wisej geolocation control properties UtcDateTime and ClientDateTime based on javascript call:
new Date().getTimezoneOffset();//gets the timezone offset

Thanks in advance

Activity

  1. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2017-03-23 15:01:42 UTC

    Thanks, we'll change.

  2. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2017-03-23 17:41:00 UTC

    Good catch. It's enough to remove ToLocalTime(). The client browser already returns the local time for the client.

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

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions