UTC Datetime Human Readable - Free Download Convert UTC Datetime Into Human Readable Format - UTC-time

Free Download Convert UTC Datetime Into Human Readable Format – UTC-time

Posted on

This time I will share jQuery Plugin and tutorial about Convert UTC Datetime Into Human Readable Format – UTC-time, hope it will help you in programming stack.

UTC Datetime Human Readable - Free Download Convert UTC Datetime Into Human Readable Format - UTC-time
File Size: 41.3 KB
Views Total: 1731
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

The UTC-time jQuery plugin automatically converts ISO formatted UTC time (last 60 days) into a human readable, auto updating string: x days/hours/minutes/seconds ago.

How to use it:

1. Insert the minified version of the jQuery UTC-time plugin after jQuery.

1 <script src="/path/to/cdn/jquery.slim.min.js"></script>
2 <script src="/path/to/dist/jquery-utc-time.min.js"></script>

2. Insert the UTC time into the data-utc-time attribute.

1 <p data-utc-time="01/15/2020 05:00:00 AM"></p>

3. Initialize the jQuery UTC-time plugin and done.

1 new UtcTime({
2   daysAgo: ' Days Ago',
3   hoursAgo: ' Hours Ago',
4   minutesAgo: ' Minutes Ago',
5   secondsAgo: ' Seconds Ago'
6 });

4. This will output the human readable time in the p.

1 <p data-utc-time="01/15/2020 05:00:00 AM">
2   31 hours ago
3 </p>

5. If the the number of days you provide is greater than 60 days:

1 <!-- Converts ... -->
2 <p data-utc-time="11/7/2017 05:00:00 AM"></p>
3  
4 <!-- Into ... -->
5 <p data-utc-time="11/7/2017 05:00:00 AM">
6   2017/11/7
7 </p>

6. Change the default data attribute:

1 new UtcTime({
2   attr: 'data-utc-time'
3 });

7. Customize the date format:

1 new UtcTime({
2   format: 'yyyy MM dd hh:mm:ss',
3 });

8. More configurations.

1 new UtcTime({
2   disableAgo: false,
3   disableHover: false,
4   disableAutoUpdate: false
5 });

Changelog:

2020-05-17

  • v2.0.0

2020-01-22

  • v1.3.11: Bugfix

2020-01-16

  • v1.3.9

2019-08-05

  • v1.3.8: Support init once.

2019-06-10

  • v1.3.6: More bugs fixed

2019-04-26

  • v1.3.3: Support new forceInitUTCTime

2019-01-25

  • v1.3.2: Fix an issue.

2019-01-10

  • v1.3.0: support more features.

2018-12-07

  • Bugfix

2018-12-06

  • v2.1.0

This awesome jQuery plugin is developed by Anduin2017. For more Advanced Usages, please check the demo page or visit the official website.