Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Test your time-dependent app by monkey patching the Date function and overriding your system time.
JavaScript
Tag: 0.2.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
test
.gitignore
.jshintrc
.travis.yml
Gruntfile.js
README.md
bower.json
karma.conf.js
package.json
timemachine.js
timemachine.min.js

README.md

timemachine Build Status

Test your time critical app by overriding the native Javascript Date function. Timemachine is compatible with global namespaces, RequireJS, CommonJS and NodeJS.

Installation

Bower

$ bower install timemachine

NPM

$ npm install timemachine

Usage

timemachine.config({
  dateString: 'December 25, 1991 13:12:59'
});

console.log(new Date()); // December 25, 1991 13:12:59

Config parameters

Parameter Description Example
dateString Date you want set as a string December 25, 1991 13:12:59
timestamp Date you want set as a timestamp 693663179000
difference Time offset in milliseconds 10000
Something went wrong with that request. Please try again.