Skip to content
Go to file
Cannot retrieve contributors at this time
20 lines (16 sloc) 548 Bytes
title version signature
Changing Time Source
2.11.0 = function () { return +new Date(); }

If you want to change the time that Moment sees, you can specify a method that returns the number of milliseconds since the Unix epoch (January 1, 1970).

The default is: = function () {
    return +new Date();

This will be used when calling moment(), and the current date used when tokens are omitted from format(). In general, any method that needs the current time uses this under the hood.

You can’t perform that action at this time.