Created
March 30, 2020 22:10
-
-
Save volkovasystems/edf16298ef471daa3cc8d2a37e97b619 to your computer and use it in GitHub Desktop.
Get Date Time Procedure
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 getDateTime = ( | |
function getDateTime( ){ | |
const dateNowObject = ( | |
new Date( ) | |
); | |
return ( | |
[ | |
( | |
dateNowObject | |
.getFullYear( ) | |
), | |
( | |
( | |
dateNowObject | |
.getUTCMonth( ) | |
+ 1 | |
) | |
.toString( ) | |
.padStart( | |
2, | |
"0" | |
) | |
), | |
( | |
dateNowObject | |
.getUTCDate( ) | |
.toString( ) | |
.padStart( | |
2, | |
"0" | |
) | |
), | |
( | |
dateNowObject | |
.getUTCHours( ) | |
.toString( ) | |
.padStart( | |
2, | |
"0" | |
) | |
), | |
( | |
dateNowObject | |
.getUTCMinutes( ) | |
.toString( ) | |
.padStart( | |
2, | |
"0" | |
) | |
), | |
( | |
dateNowObject | |
.getUTCSeconds( ) | |
.toString( ) | |
.padStart( | |
2, | |
"0" | |
) | |
) | |
] | |
.join( | |
"" | |
) | |
); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment