How Do I Change Epoch Time in Linux?
Contents

How do I convert epoch to date?

Convert from epoch to human-readable date

String date = new java.text.SimpleDateFormat(“MM/dd/yyyy HH:mm:ss”).format(new java.util.Date (epoch*1000)); Epoch in seconds, remove ‘*1000’ for milliseconds. myString := DateTimeToStr(UnixToDateTime(Epoch)); Where Epoch is a signed integer. Replace 1526357743 with epoch.

How do I convert time to epoch time in Linux?

Use the build-in date command and instruct it to output the number of seconds since 1970-01-01 00:00:00 UTC. You can do this by passing a format string as parameter to the date command. The format string for UNIX epoch time is ‘%s’. To convert a specific date and time into UNIX epoch time, use the -d parameter.

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest