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

Issue #86: Added support for Unix Timestamps #168

Closed
wants to merge 5 commits into from
Closed

Issue #86: Added support for Unix Timestamps #168

wants to merge 5 commits into from

Conversation

kwkofler
Copy link
Contributor

No description provided.

@modeswitch
Copy link
Member

Needs rebase.

@kwkofler
Copy link
Contributor Author

Rebased.

@modeswitch
Copy link
Member

Tests are now failing here.

return time.getTime() / 1000;
}
callback(new Errors.EINVAL('Cannot parse time: ' + time));
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary.

@humphd
Copy link
Contributor

humphd commented May 13, 2014

Is this ready to go now? I see the tests are passing.

atime = (atime) ? atime : currentTime;
mtime = (mtime) ? mtime : currentTime;

try {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utimes_file already checks these parameters, so if you call toUnixTimestamp in there you can assume integer arguments.

@humphd
Copy link
Contributor

humphd commented May 13, 2014

@kwkofler you still gonna finish this, or do I need to find a new owner?

@kwkofler
Copy link
Contributor Author

I can finish it. I should hopefully have time tonight or tomorrow evening, the commute to my coop placement is consuming a lot of my day.

@kwkofler
Copy link
Contributor Author

Has anyone had a chance to take a look at this? Let me know if I misunderstood the feedback.

if (typeof time === 'number') {
return time;
}
if (typeof time === 'object' && Object.prototype.toString.call(time) === '[object Time]') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to if (typeof time === 'object' && typeof time.getTime === 'function')

@humphd
Copy link
Contributor

humphd commented Dec 15, 2018

Fixed this up so it could land on master, updated our Stats implementation to match node too, so we have both Date and timestamp versions of all times, fixed docs to match, fixed a ton of tests, added new tests.

443b582.

@humphd humphd closed this Dec 15, 2018
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

4 participants