Legacy Dev Forum Posts

 View Only

Sign Up

ToDateTime function returns false date time value

  • 1.  ToDateTime function returns false date time value

    Posted 06-05-2025 19:15

    ibrahimsincap | 2024-02-19 12:51:47 UTC | #1

    Hi,

    We have an API that returns a date time parameter as an integer. When I test it, I saw that it returns a weird value. The integer value is 1737814632147. Returned value is "57039-02-26T06:42:27.000Z".

    I tried to convert int to date in JS and it returns "2025-01-25T14:17:12.000Z", so I expect Cloud to do the same.

    Am I doing something wrong?

    Regards.


    SimonBrown | 2024-02-19 14:31:15 UTC | #2

    Looking at number it looks closer to a UNIX timestamp. 10 digits is the number of seconds, 13 is in milliseconds.

    If Unix then its the number of seconds since 01/Jan/1970 You need to add the number of seconds to that date to get the datetime stamp you probably want. Depending on accuracy required I guess you could "drop" the milliseconds


    ibrahimsincap | 2024-02-19 15:14:52 UTC | #3

    Hi,

    Thank you so much for your help, removing last three digits has fixed the problem.

    Best regards!


    system | 2024-03-21 15:15:52 UTC | #4

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 24724