Created
September 6, 2023 03:34
-
-
Save kcsinclair/7d2b08a13551d777293a11dadc73cd6b to your computer and use it in GitHub Desktop.
Using Linux date to convert dates and handle epoch times
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
# Display current time in Unix epoch (seconds since 1970-01-01 UTC). | |
date +%s | |
# Display a specific time in Unix epoch. | |
date --date="1 Jan 2000" +%s | |
#Convert seconds since the epoch (1970-01-01 UTC) to a date | |
date --date='@2147483647' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment