Get Date and Time from Unix Timestamp on Linux

Get Date and Time from Unix Timestamp on Linux

A Unix timestamp represents the number of seconds elapsed since the Unix Epoch (January 1, 1970, at 00:00:00 UTC). It is widely used as a standard for timekeeping in programming, system logs, and data exchange due to its simplicity and consistency across different platforms and time zones. Many programming languages and operating systems, including Linux, offer built-in tools to convert Unix timestamps into human-readable formats or manipulate them as needed. This tutorial explains how to get date and time from Unix timestamp on Linux.

To convert a Unix timestamp (e.g., 1740060520) into a readable date and time format, use the following command:

date -d @1740060520

This will output something like:

Thu Feb 20 14:08:40 UTC 2025

The -d flag allows us to specify a date string, and the @ symbol tells date to interpret the input as a Unix timestamp.

Leave a Comment

Cancel reply

Your email address will not be published.