js-date
v0.1.3
Published
jsDate is written in javascript, and it makes javascript date process like php date function.
Downloads
3
Readme
jsDate
jsDate is written in javascript, and it makes javascript date process like php date function.
How to use
# for nodejs
$ npm install js-date --save
//use js-date as module
var jsDate = require("js-date");
<!--load js-date as normal script file-->
<script src="./js-date.js"></script>
API
// jsDate.date api
jsDate.date([dateFormatString], [dateTimeOffset], [dateTime]);
Example
var today=jsDate.date('Y-m-d'),
nowTime = jsDate.date("Y/m/d H:i:s"),
yesterday=jsDate.date('Y-m-d','-1day'),
twoWeeksLater=jsDate.date('Y-m-d','+2week'),
customTime=jsDate.date('Y/m/d H:i:s',new Date('2012-02-14 15:30:20')),
customString=jsDate.date('\\\D\\\a\\\y:l',new Date('2012-02-14 15:30:26')),
constellation=jsDate.date('e');
More API please refer to PHP Date