-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UTC time formatting for the correct timezone #105
Comments
The only timezone support currently is in the "z" "zz" and "zzz" format tokens. See https://github.com/jquery/globalize#date-formatting. Beyond that, I can't think of any planned support for timezone support. It certainly isn't part of culture information. Can you provide a use case or a suggested API to help me understand your hope? |
I need it to parse the utc time from our database records to show the correct time to the user. I also need it to parse the local time (filled out by user) to utc, before doing my Json post to the server. |
Here is a use case: Most brokerage application display trade time in ET, regardless of where you are currently. A common trick for that is to ask Json service to send the epoch and the current ET offset (4 or 5 depending on the season), then subtract the offset and format the 'altered' epoch in UTC. The formatting logic for this is identical to that currently provided by your library except that you need to call getUTCHours() etc. on the Date object rather than getHours() etc. |
Another case that we could use is a list of the time zones fx... (GMT - 05:00) Eastern Time (US & Canada) Localized into the Locale / language. This way when showing a list of timezones to the user they can see it in their language. This goes along with the days/months provided.. |
Globalize supports formatting and parsing timezones that doesn't require any additional logic to the Native JavaScript Date Object. We call it basic timezone support. It means no other timezones than the local user environment's. It also means no Olson/IANA timezone names. More information can be found on #202. For more information of a possible implementation of Olson-timezone-ExtendedDate support can be found here: #340. |
Fix exceptions when i18n metadata is used
Is there an option to format a UTC time to the correct timezone and vice versa? Don't know if this is the right place to ask for it. I think this will add great value to the plugin. Hopefully it is available or will be added soon.
The text was updated successfully, but these errors were encountered: