Skip to content
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

Closed
marcofranssen opened this issue May 16, 2012 · 5 comments
Closed

UTC time formatting for the correct timezone #105

marcofranssen opened this issue May 16, 2012 · 5 comments

Comments

@marcofranssen
Copy link

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.

@rdworth
Copy link
Contributor

rdworth commented May 16, 2012

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?

@marcofranssen
Copy link
Author

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.

@jhrabows
Copy link

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.

@tmcconechy
Copy link

Another case that we could use is a list of the time zones fx...

(GMT - 05:00) Eastern Time (US & Canada)
(GMT - 07:00) Mountain 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..

@rxaviers
Copy link
Member

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.

ashensis pushed a commit to ashensis/globalize that referenced this issue Mar 17, 2016
Fix exceptions when i18n metadata is used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants