How to convert unix timestamps to human-readable date?

Eekki
Eekki Member
edited December 2023 in General

Hi,

Does any one know how to convert Unix timestamps to human-readable date?

Example Unix timestamp: 1568732257 --> wanted format: 2021-09-17 14:57:37 (Year-Month-Date Hour:Min:Sec)

Tagged:

Best Answer

Answers

  • Clinton Jones
    Clinton Jones Experian Elite
    edited April 2021

    Hi @Eekki I would be interested to see what one of the smart people in the community come up with for this one. For those who aren't aware, the Unix timestamp in its raw format is based on elapsed seconds since Jan 1 1970. there is a handy converter to be found here : Unix Time Stamp - Epoch Converter. My initial thoughts are that there may be a way to easily do this using a regex, alternatively a calculation using the divisors.

    C

  • Sueann See
    Sueann See Experian Super Contributor

    @Eekki just purely based on the description that the "The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970" (wikipedia), the following functions could work.


  • Eekki
    Eekki Member

    Thank you both for your quick answers. I appreciate your answers.

  • Clinton Jones
    Clinton Jones Experian Elite
    edited April 2021

    @Eekki to get you even closer to your desired result, consider also using a variable, parsing the resulting date elements and concatenating them