Created
January 19, 2018 16:02
-
-
Save syzer/7aebf9c873dffeac40d03e27349d9065 to your computer and use it in GitHub Desktop.
today
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { padStart } = require('lodash') | |
const pad0 = e => padStart(e, 2, '0') | |
const date = new Date() | |
const today = [ | |
date.getUTCFullYear(), | |
pad0(date.getUTCMonth() + 1), | |
pad0(date.getUTCDate()) | |
].join('.') | |
// => 2018.01.19 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment