You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mysqldate

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysqldate

MySQL Timestamp support for javascript's Date object.

0.1.6
latest
Source
npmnpm
Version published
Weekly downloads
34
-2.86%
Maintainers
1
Weekly downloads
 
Created
Source

MySQL Date for Javascript

extends javascript's Date object with four new methods designed to assist with handling MySQL Timestamps.

Examples

toMysqlDate & toMysqlUTCDate methods:

var date = new Date();
date.toMysqlDate();         // Outputs: '2016-08-28 22:45:37' (String)
date.toMysqlUTCDate();      // Outputs: '2016-08-28 19:45:37' (String)

fromMysqlDate & fromMysqlUTCDate methods:

Date.fromMysqlDate('1979-03-28 23:45:37');       // Outputs: (Date object)
Date.fromMysqlUTCDate('2013-03-28 11:11:52');    // Outputs: (Date object)

Installtion

Installation Using NPM

npm install mysqldate

Usage:

require('mysqldate');

Installation Using Bower

bower install mysqldate

Insert before your scripts:

<script src="bower_components/mysqldate/mysqldate.js" type="text/javascript"></script>

Keywords

mysql

FAQs

Package last updated on 16 Sep 2016

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