Skip to content

Instantly share code, notes, and snippets.

@volkovasystems
Created March 30, 2020 22:10
Show Gist options
  • Save volkovasystems/edf16298ef471daa3cc8d2a37e97b619 to your computer and use it in GitHub Desktop.
Save volkovasystems/edf16298ef471daa3cc8d2a37e97b619 to your computer and use it in GitHub Desktop.
Get Date Time Procedure
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