Hands-on task
This task is step 3 of the course “Dates and times in the terminal”
Get Unix time from a date
The file /root/when.txt contains a date with time and timezone: 2024-03-01 12:00:00 UTC. Convert it to a Unix timestamp (the number of seconds since the epoch) and write the number to /root/epoch.txt. Note: the sandbox's system time zone is Europe/Berlin, not UTC.
Reference:date
What you'll practise:
- date
- unix time
- epoch
- timezones