This time I will share jQuery Plugin and tutorial about jQuery Plugin To Render Time In Users’ Timezone – usertime.js, hope it will help you in programming stack.
usertime.js is an ultra-light time manipulation plugin that parses, formats and displays ISO 8601 date and Unix timestamp in users’ timezone.
How to use it:
1. The plugin requires jQuery library and moment.js loaded in your document.
1 |
< script src = "/path/to/jquery-1.11.3.min.js" ></ script > |
2 |
< script src = "/path/to/moment.min.js" ></ script > |
2. Include the usertime.js after jQuery library.
1 |
< script src = "/path/to/usertime.js" ></ script > |
3. That’s it. The plugin will convert …
1 |
< usertime >1441099707112</ usertime > |
2 |
< usertime >2015-09-03T09:28:27+00:00</ usertime > |
to …
4. Customize the output format.
1 |
< usertime format = "lll" >1441099707112</ usertime > |
Change log:
2016-08-26
- Fixed MutationsObserver detection behavior.
2016-08-23
- Added MutationObserver detection.
2015-10-24
This awesome jQuery plugin is developed by emn178. For more Advanced Usages, please check the demo page or visit the official website.