Skip to content

Instantly share code, notes, and snippets.

@sonnyksimon
Last active May 30, 2024 12:53
Show Gist options
  • Save sonnyksimon/e8e9be1ece39ec3ded02228c75771982 to your computer and use it in GitHub Desktop.
Save sonnyksimon/e8e9be1ece39ec3ded02228c75771982 to your computer and use it in GitHub Desktop.
example input: "2024-01-01"
(strptime("%Y-%m-%d") | mktime | strftime("%Y-%m-01") | strptime("%Y-%m-%d") | mktime | todate)
(strptime("%Y-%m-%d") | mktime | strftime("%Y-%m-28") | strptime("%Y-%m-%d") | mktime + (4 * 24 * 60 * 60)) | (. - ((strftime("%d") | tonumber) * 24 * 60 * 60) | todate)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment