Created
February 22, 2018 01:34
-
-
Save yowcow/a564b8ad2d6632d9133b60dfcbe6eb42 to your computer and use it in GitHub Desktop.
Converting epoch second to date time, and vice versa
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
EPOCH = 0 | |
DATE = 1970-01-01 00:00:00 JST | |
all: | |
now: | |
date | |
date +%s | |
date: | |
date -d @$(EPOCH) | |
epoch: | |
date -d"$(DATE)" | |
date -d"$(DATE)" +%s | |
.PHONY: all now date epoch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment