Aspnet Zero Time on client side is incorrect when daylight saving is on - timezone

In AspNet Zero Core + Angular Project. I have Set Clock Provider to UTC Clock.Provider = ClockProviders.Utc; in Startup.cs
as stated in the document which causes timezone selection in settings for user and Tenant Settings and saves UTC dates in db.
Problem is these Days 30th Oct 2020, MST (Mountain Standard Time) is observing Daylight Saving but times on the angular project is not respecting that its showing one hours difference...
One possible Option Scenario is to Select MDT instead of MST but that's not available in Timezone Dropdown in aspnetzero as its using windows timezones...
anyone ever managed to deal with this issue?
PS:In their support articles they claim that it should be automatically handeled by momentjs but its not... Maybe i'm missing somthing?

Related

Dynamic timezone UTC

I have a system that user when registering a task determining the time that it should be done. By default rails works with UTC at the time, but I'd like to be changing the time zone according to the user's locale.
Anyone can help?

Change jenkins timestamp according to the browser timezone

I have a really simple question and couldn't find the answer about. Is it possible to change the jenkins timestamp according to the user's browser timezone. As my Jenkins server is in UTC but some of our users are in Central timezone while other are in few different timezones. So I want that they see the task(s) timestamp according to their browser time/timezone. How we can achieve this? Thanks
One possible approach for this could be to deliver all dates in a default timezone and use momentjs or a similar library to convert the date time on the frontend side to either the browsers timezone (this could be the default) or to a manually selected one.
This would be rather easy to implement and would not require any big changes in jenkins itself, just all places that deliver times must be wrapped in some markup, e.g. a class and some data-fields (e.g. data-datetime containing an rfc3339 timestamp)
Jenkins issues JENKINS-19887 and JENKINS-1962 detail potential fixes that could be introduced, though they haven't been implemented in any version of the system yet.
If you're only looking for timestamps with the browser's time zone in your console output (with all other timestamps unmodified), Timestamper provides this functionality.

Wrong date is displayed in Magento Admin Dashboard

I have an issue with the date and time being shown incorrect in magento admin dashboard. I have set the Timezone as Pacific Standard Time(America/Los_Angeles) through Configuration>system>General>Locale Options
but the current Date in the admin dashboard is Sunday, February 7, 2016 where as it should be Tuesday, February 6, 2016. This is affecting the cron schedule which in turn is affecting the email queue. Could you please help me fix this. I am unable to find the module that is overriding the magento's default timezone.

Correcting a column in Rails Postgresql database (timezone issue)

When I built my web app it was, unknowingly to me, set to use UTC by default. One of my model's attributes is a DateTime called event_date which is manually set by the user. The users thought they we're selecting CST while behind the scenes everything was still in UTC.
Now I am pulling events from Facebook Graph API, and they display the "wrong" time (what I recently found out is actually the correct UTC time). When I changed my application.rb file to include
config.time_zone = 'Central Time (US & Canada)'
It solves the issue of the Facebook times being wrong. However, all of my previous database entries are now incorrect due to their event_date's being entered as incorrect UTC times.
What is the best way to go about resolving this? I assume the best method would be to convert or offset the entire event_date column of my database to the correct UTC time, but I am unsure how to go about doing this.
The app is built with Ruby on Rails, I'm using Postgresql, and I am deploying through Heroku.

MVC Handling Timezones and JSON Serialization - How to Convert to Specific Timezone

I've spent quite a bit of time on stackoverflow and the internet trying to determine what has been done in my situation. I am building a
centralized line of business website that could span multiple timezones. Based on some valuable information here I have a plan in place to handle this.
Timezone will be a part of a user profile
All Dates will be stored in UTC
EF sets DateTimeKind to UTC on retrieval from database
Is it possible to prevent EntityFramework 4 from overwriting customized properties?
Create some html helpers for DatePickers and DateDisplays to convert UTC time to local time (based off user timezone)
Use Model Binding to convert back to UTC on form posts.
Timezone Strategy
Now to the issue I don't know how to solve. Kendo UI uses JSON to pass information back and forth and as far as I can tell the JSON.net serializer cannot serialize a date to a specific time zone. I can serialize the date as UTC or have JSON.net automatically convert it to local time using the DateTimeZoneHandling setting but that would be local time on the server. From looking at the JSON.net code, I'm not sure I could even write a converter to do what I wanted. So far now if I send the date as UTC through JSON.net and Kendo automatically converts the time to the browser's local timezone.
Assuming User Profile timezone = Browser Timezone seems a little scary for me and I wanted to see what stackoverflow suggests I do. Thank you in advance.
Technology
ASP.net MVC 5
Entity Framework 6
Telerik Kendo UI Controls
JSON.net
Unfortunately I don't know many of the tools you are using, but I know how I would handle timezones.
I would use UTC everywhere, except when displaying times (or rather: datetimes) and in user input.
I would let the browser's JavaScript do the conversion in output, using the browser's timezone. In input, the conversion can be done either client side or server side. In the latter case the timezone must be part of the information sent from the browser to the server. The UTC timezone on the servers should be set at a level as low as possible, and, if possible, in all components (OS, web server, DB...).
A user's preferred timezone is nonetheless useful for all cases where the timezone is not known (e.g., in email communications - but remember to always have the timezone in time formats).
There are times (no pun intended...) when the above is not easy or does not apply. E.g., a schedule (calendar), to which the user attaches the timezone they have in their head, not necessarily the browser's one. Another case is when the user's timezone has to be known for some computation that can not easily be done on the browser - in this case the server will have to get the timezone from the browser first. But most of the time (still no pun intented...) you can happily do without timezones (with UTC) except immediately before showing something to the user or immediately after getting something from the user.
Regarding your last paragraph: you will very soon run into trouble if you assume "user profile timezone = browser timezone".
Some last words of advice:
"Timezone" is an ambiguous term. It may refer to a fixed offset from UTC (like UTC+1), or to the rules for calculating this offset for any instant in a given area (like the timezone of Rome, Italy). Always use the second meaning (e.g., don't use the current offset for a date in the future or past, but correctly convert datetimes back and forth), and remember that both can change during a user's session.
Be careful not to handle "pure" dates as the midnight of the same day (and not as noon either - people in Samoa will thank you), because then the date can change when the timezone changes. In other words, don't attach time information to pure dates.
P.S.: By following a link of yours, I was happy to find that I totally agree with the closing remark of this answer (by someone with more SO reputation than me)
You certainly can pass UTC to the browser and let it convert, but you have to be aware of the potential for inaccuracies. You also can convert server-side and pass a DateTimeOffset in your JSON, but you may need to render it yourself, using something like moment.js.
In the end, what you should do is entirely up to you. Many use cases are similar, but there are plenty of acceptable different paths depending on your exact needs.
Your question is very broad the way you have asked it. What parts are you most concerned with? Kendo? EF? JavaScript? Client-side time zone conversion? Formatting? Could you refine it or provide some context to the type of things your date/time values are representing? Otherwise, you may get some useful tidbits, but it will be hard to provide a definitive answer.
(Oh, and you might be interested in this.)
I was finally able to find this answer here https://stackoverflow.com/a/11968692/3412859 that will allow me to write my own JSONconverter and convert to a specific time zone before it is serialized. I now have all of the dates being converted on the server side based on the timezone setting in the user profile.
I had this problem , too.
It works for me.
I translated the time format to
Start=2016-4-9T8:30:00.000Z
End=2016-4-9T13:30:00.000Z
in background or database.
By doing this,local time zone is useful.

Resources