Linux Timestamp Conversion: Quick Guide
In Linux systems, the date command can be used to convert timestamps. Here are some commonly used methods for timestamp conversion.
- Convert timestamp to datetime format.
date -d @<timestamp>
- Convert the date and time format to a timestamp.
date -d "<date time>" "+%s"
The
- Get the current timestamp.
date "+%s"
With the above command, it is easy to convert between timestamps and date times in a Linux system.