Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haochi/strftime
strftime for JavaScript.
https://github.com/haochi/strftime
Last synced: about 9 hours ago
JSON representation
strftime for JavaScript.
- Host: GitHub
- URL: https://github.com/haochi/strftime
- Owner: haochi
- Created: 2011-07-17T23:04:44.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-07-19T04:11:30.000Z (over 13 years ago)
- Last Synced: 2023-03-15T22:10:33.240Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://haochi.github.com/strftime/
- Size: 94.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# strftime
Just another attempt at formatting JavaScript dates using the ** cough ** familiar strftime syntax.
I wrote this for a tool that enables you to build up the strftime format string interactively. You can check it out in [action here](http://haochi.github.com/strftime/).# usage
`strftime` is a method on the Date object as well as Date.prototype. To for a specific instance of the Date object, you can dovar date = new Date(2011, 0, 1);
date.strftime("%s"); // returns 1293858000, the number of seconds since the Epoch
or if you would like to format the current time:Date.strftime("%s");
# tests
I haven't gotten around to write tests yet, so use with care!