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

Log the date along with the time (now 24hr) #23

Merged
merged 3 commits into from
Nov 18, 2013
Merged

Log the date along with the time (now 24hr) #23

merged 3 commits into from
Nov 18, 2013

Conversation

imbcmdth
Copy link
Member

fixes #21

m = d.getMinutes(),
s = d.getSeconds(),
date = [Y, pad2(M), pad2(D)].join('-'),
time = [pad2(h), pad2(m), pad2(s)].join(':');
Copy link
Member

Choose a reason for hiding this comment

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

var datetime = (new Date).toISOString().split('.')[0].replace('T', ' ');

Copy link
Member

Choose a reason for hiding this comment

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

why not just leave the T? An ISO-compliant string is nice and readable, AND immediately parseable.

Copy link
Member

Choose a reason for hiding this comment

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

well, in that case we could just do var datetime = (new Date).toISOString() and leave it at that.
I was being a bit facetious to get the line count smaller.

@imbcmdth
Copy link
Member Author

You guys win! :P

imbcmdth added a commit that referenced this pull request Nov 18, 2013
Log the date along with the time (now 24hr)
@imbcmdth imbcmdth merged commit a08a959 into master Nov 18, 2013
@imbcmdth imbcmdth deleted the log-date branch November 18, 2013 03:56
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.

Add date to log output
3 participants