Base solution for your next web application
Open Closed

abp.clock.now() mismatach #2746


User avatar
0
bilalhaidar created

Hi, I have the following generated scripts:

(function(){
    abp.clock.provider = abp.timing.utcClockProvider || abp.timing.localClockProvider;
    abp.clock.provider.supportsMultipleTimezone = true;
    abp.timing.timeZoneInfo =  {        windows: {            timeZoneId: 'Azerbaijan Standard Time',            baseUtcOffsetInMilliseconds: '14400000',            currentUtcOffsetInMilliseconds: '14400000',            isDaylightSavingTimeNow: 'False'        },        iana: {            timeZoneId:'Asia/Baku'        },    }
})();

When I type abp.clock.now() it gives something like: Wed Mar 22 2017 03:00:24 GMT+0200 (GTB Standard Time)

But as you see above, I set myself for a timezone that is +4 GMT.

How come abp.clock.now() gives GMT+2?


5 Answer(s)
  • User Avatar
    0
    bilalhaidar created

    Even check the attached file.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Both values are same actually. When you write abp.clock.now() browser displays it's value in it's own way.

    So if you use moment to display value of abp.clock.now() using moment in the browser console, I think values will be represented same.

    Alkso, you can try abp.clock.now() in other browser consoles and see the difference.

  • User Avatar
    0
    bilalhaidar created

    Thanks. It makes sense now.

    Since the timezone is +4, this explains the "+4" at the end of the moment date. Had the timezone be UTC, then the moment date displayed would be shown in UTC.

    I dunno why this confuses me again, thanks for the explanation. Now I am fine.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    DateTime and TimeZone is a bit complex area I think, this happens me all the time :)

  • User Avatar
    0
    bilalhaidar created

    Thanks for making things easy on me :)