How to obtain the current timestamp in Linux?

In Linux systems, you can use the date command to obtain the current timestamp.

Open the terminal and type the following command:

date +%s

After executing the command, the terminal will output the current timestamp, which is the number of seconds that have passed since January 1, 1970, 00:00:00 UTC.

Additionally, you can use the date command to convert a timestamp into a specific date and time. For example:

date -d @时间戳

Replace the timestamp above with the timestamp you want to convert, then execute the command, and the terminal will output the corresponding date and time.

广告
Closing in 10 seconds
bannerAds