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

Support multiple time zones #330

Closed
taropaa opened this issue Jan 30, 2018 · 3 comments
Closed

Support multiple time zones #330

taropaa opened this issue Jan 30, 2018 · 3 comments

Comments

@taropaa
Copy link

taropaa commented Jan 30, 2018

Currently the script only supports Zulu time. It would be nice if other time-zones would also be supported such as per the ISO 8601 specifications https://en.wikipedia.org/wiki/List_of_military_time_zones

@rmm5t
Copy link
Owner

rmm5t commented Jan 30, 2018

Currently the script only supports Zulu time

Not true.

It would be nice if other time-zones would also be supported

They are. Try 2018-01-29T21:54:34-07:00

such as per the ISO 8601 specifications

Granted, this parser isn't complete, but there's little benefit to expanding it much more.

https://en.wikipedia.org/wiki/List_of_military_time_zones

Are you just asking for the special military time time zone designator characters?

@taropaa
Copy link
Author

taropaa commented Jan 30, 2018

Hi Ryan, thank you for your quick reply.
You are correct, I was able to get the ISO 8601 spec to work eventually. and yes I am referring to military time.
In your example you are using <time class="timeago" datetime="2011-12-17T09:24:17Z">December 17, 2011</time>. I am assuming Z stands for Zulu. Looking at the link, I needed Romeo time, and tried <time class="timeago" datetime="2011-12-17T09:24:17R">December 17, 2011</time> which no longer works.
I was able to get it to work using
<time class="timeago" datetime="2011-12-17T09:24:17-5:00">December 17, 2011</time>

@rmm5t
Copy link
Owner

rmm5t commented Jan 30, 2018

Cool. 😎

Yes, the Z stands for Zulu, but the only reason this library parses it (and not the other military designators, which are quite rare, btw) is because that particular time zone designator (`Z') is special in that many languages will use this short-cut syntax when outputting ISO8601 timestamps in UTC.

For example, in Ruby:

>> Time.now.iso8601
=> "2018-01-30T08:00:27-07:00"
>> Time.now.utc.iso8601
=> "2018-01-30T15:00:31Z"

@rmm5t rmm5t closed this as completed Jan 30, 2018
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

2 participants