Get Current Unix Timestamp on Windows

Get Current Unix Timestamp on Windows

The Unix timestamp represents the count of seconds elapsed since the Unix Epoch, which occurred on January 1, 1970, at 00:00:00 UTC. This timestamp serves as a globally recognized timekeeping standard and finds widespread use in a variety of programming applications, system logging, and data interchange protocols. This tutorial explains how to get current the Unix timestamp on Windows.

On Windows systems, obtaining the current Unix timestamp is a straightforward process that can be achieved using PowerShell.

[DateTimeOffset]::Now.ToUnixTimeSeconds()

This command creates a DateTimeOffset object representing the current date and time and then converts it to a Unix timestamp.

Output example:

1694325019

Leave a Comment

Cancel reply

Your email address will not be published.