Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternate Clock Source Support #2766

Closed
wants to merge 2 commits into from
Closed

Alternate Clock Source Support #2766

wants to merge 2 commits into from

Conversation

atogata
Copy link
Contributor

@atogata atogata commented Nov 22, 2015

Fix #2337

Motivation: Need to implement client-side time synchronization for other project.

Example:

moment().toISOString()
"2015-11-22T23:02:47.586Z"

moment.fn.now = function() { return 10000; };
() { return 10000; }

moment().toISOString()
"1970-01-01T00:00:10.000Z"

moment.fn.now = function() { return Date.now() * 2; };
() { return Date.now() * 2; }

moment().toISOString()
"2061-10-13T22:06:22.934Z"

@jokesterfr
Copy link

I like it, it's a clean way to customize the now() method.

@icambron
Copy link
Member

👍

@ichernev
Copy link
Contributor

ichernev commented Dec 9, 2015

Merged in 816245f

@ichernev ichernev closed this Dec 9, 2015
ichernev added a commit that referenced this pull request Dec 9, 2015
@mattjohnsonpint mattjohnsonpint added this to the 2.10.7 milestone Dec 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants