Human Readable Unix Timestamp Converter with jQuery - Timestamp Tag
| File Size: | 6.83 KB |
|---|---|
| Views Total: | 1333 |
| Last Update: | |
| Publish Date: | |
| Official Website: | Go to website |
| License: | MIT |
Timestamp Tag is a lightweight jQuery plugin for converting UNIX timestamp into human readable date & time with custom formats.
How to use it:
1. Include the jQuery timestamp tag plugin after you've included jQuery library but before the closing body tag.
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script> <script src="lib/timestamp-tag.js"></script>
2. Add a UNIX timestamp to your webpage.
<timestamp format="l dS /o/f F Y h:i:s A"
title-format="d:m:Y h:i:s">
1450632633
</timestamp>
3. That's it. The plugin will output:
Wednesday 25th of February 2015 18:58:03 PM
4. Enable 'timeAgo' mode to make the output more human readable.
<timestamp timeago="true"
format="l dS /o/f F Y h:i:s A"
title-format="d:m:Y h:i:s">
1450632633
</timestamp>
5. The plugin will output:
8 hours ago
6. Custom dataTime format.
d: Day of the month, 2 digits with leading zerosD: A textual representation of a day, three lettersj: Day of the month without leading zerosl: A full textual representation of the day of the weekN: ISO-8601 numeric representation of the day of the weekS: English ordinal suffix for the day of the month, 2 charactersw: Numeric representation of the day of the week. 0 (for Sunday) through 6 (for Saturday)W: ISO-8601 week number of year, weeks starting on MondayF: A full textual representation of a month, such as January or March January through Decemberm: Numeric representation of a month, with leading zerosM: A short textual representation of a month, three lettersn: Numeric representation of a month, without leading zerost: Number of days in the given month 28 through 31Y: A full numeric representation of a year, 4 digitsy: A two digit representation of a yeara: Lowercase Ante meridiem and Post meridiem am or pmA: Uppercase Ante meridiem and Post meridiem AM or PMg: 12-hour format of an hour without leading zerosG: 24-hour format of an hour without leading zerosh: 12-hour format of an hour with leading zerosH: 24-hour format of an hour with leading zerosi: Minutes with leading zeross: Seconds, with leading zeros
This awesome jQuery plugin is developed by Pakipreneurs. For more Advanced Usages, please check the demo page or visit the official website.











