Skip to content

Instantly share code, notes, and snippets.

@roelds
Created September 9, 2023 19:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roelds/e1080c104b1aeca569bbebdeab6ad1b6 to your computer and use it in GitHub Desktop.
Save roelds/e1080c104b1aeca569bbebdeab6ad1b6 to your computer and use it in GitHub Desktop.
my timestamp as filename format in Linux & Windows
# 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
# 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