Socket
Socket
Sign inDemoInstall

js-date

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    js-date

jsDate is written in javascript, and it makes javascript date process like php date function.


Version published
Weekly downloads
9
increased by125%
Maintainers
1
Install size
35.9 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 30 Nov 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc