Coder Social home page Coder Social logo

Comments (3)

rmm5t avatar rmm5t commented on June 9, 2024

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?

from jquery-timeago.

taropaa avatar taropaa commented on June 9, 2024

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>

from jquery-timeago.

rmm5t avatar rmm5t commented on June 9, 2024

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"

from jquery-timeago.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.