You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

js-date

Package Overview
Dependencies
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
Maintainers
1
Created

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

Package last updated on 30 Nov 2014

Did you know?

Socket

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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc