Skip to content

Conversion between JavaScript Date and WCF date string

License

Notifications You must be signed in to change notification settings

WSDOT-GIS/wcf-date

Repository files navigation

wcf-date

Build Status

Converts between WCF date and JavaScript Date object.

Install

npm install wcf-date

Use Module

Node.js

let wcfDate = require("wcf-date");

Browser

<script src="node_modules/wcf-date/lib/wcf-date.js" />

Typescript

Typescript definitions are included: lib/wcf-date.d.ts. You may need to create a new type definition file to your project and add the following:

/// <reference path="node_modules/wcf-date/lib/wcf-date.d.ts" />

Demo

let wcfDate = require("wcf-date");
let s = "/Date(1408431600000-0700)/";
let d = wcfDate.parseWcfDate(s);
// 2014-08-19T06:59:59.300Z
let s2 = wcfDate.toWcfDateString(d);
// "/Date(1408431599300)/"