aliases | category | classification | date | date_modified | draft | id | image | links | local_archive_links | pinned | series | tags | title | type | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
cli |
public |
2020-10-13 12:02:22 -0700 |
2020-10-13 12:02:22 -0700 |
false |
20201013190222 |
false |
false |
|
Linux Date Command |
tech-note |
date --set="23:59:58" # Set the system time.
date --set="2020-10-17" # Set the system date.
date --date=@1593966863 # Convert from specifed Epoch time.
date --date=@1593964977 +"%Y%m%d%H%M%S" # Convert from specified Epoch time to specific format.
date +%s -d "Jan 1, 1980 00:00:01" # Convert from human readable to Epoch.
I use this for my plain-text calendar. Update the START
and END
date variables, and then you have a list of dates you can use.
#!/bin/bash
START="2021-01-01"
for i in {1..365}; do
# custom format using +
date '+%Y-%m-%d %a' -d "$START +$i days"
done