Created
September 9, 2023 19:32
-
-
Save roelds/e1080c104b1aeca569bbebdeab6ad1b6 to your computer and use it in GitHub Desktop.
my timestamp as filename format in Linux & Windows
This file contains hidden or 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
# my format | |
get-date -format "yyyy_MM_dd_HH_mm_ss" | |
# epoch in dec | |
(Get-Date).ToUniversalTime().Subtract((Get-Date "01/01/1970")).TotalSeconds | |
# alt format | |
gcim Win32_LocalTime | select Year,Quarter,Month,WeekInMonth,DayOfWeek | fl |
This file contains hidden or 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
# my format | |
date +'%Y_%m_%d_%H_%M_%S' | |
# epoch in dec | |
date +%s | |
# epoch in hex | |
printf "%x\n" $(date +%s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment