Hello, I have some problems with the converting of โepoch/unixโ into a datetime format
Example:
epoch: 1566162000000
result datetime: 19.08.2019 00:00:00
Problem:
The time is missing and I do not know why.
Formel
DATETIME([epoch]/86400/1000+โ01/01/1970 00:00โ)
Thanks a lot
A DateTime plus a Number advances the DateTime by Number days, not seconds.
Danke / Thanks
I need you supportโฆ
What I have:
Epoch:1566179000000 (milliseconds)
Datetime: Monday, August 19, 2019 1:43:20
Result with following formel:
8/19/2019 2:00:00 AM
DATETIME( Number([Epoch]/86400/1000 ) + Datetime(Day( โ01.01.1970โ)))
Problem: The time is not correct
Thanks for helping out
Try:
Datetime(โ01/01/1970โ) + Number([Epoch] / 86400 / 1000)
Literal Date values in expressions must be formatted as MM/DD/YYYY; other formats are not recognized as Date values in expressions.
Test it: 8/19/2019 12:00:00 AM Time not ok
What should the correct result be?
Monday, August 19, 2019 1:43:20
Ah, then weโre back to my original response:
Where do you expect the time to come from?
IF you convert this โepochโ 1566179280000 via https://www.epochconverter.com/
Than you get the โDate timeโ as result.
thx
AppSheet is not epochconverter.com; AppSheet doesnโt work the same way.
ok thanks a lot
I know this is an old post, but I have been working on a similar problem: converting a date saved in the database as unix time stamp in seconds into an actual datetime in AppSheet.
The formula I achieved (after seveal attempts) is the following:
DATETIME(โ01/01/1970โ) +
FLOOR([reception_date] / (24*60*60)) +
(
TIME(
CONCATENATE(
FLOOR( MOD([reception_date], 24*60*60) / (60*60) ),
":",
FLOOR( MOD([reception_date], 60*60) / 60 ),
":",
FLOOR( MOD([reception_date], 60) )
)
)
- "00:00:00"
)
DATETIME(โ01/01/1970โ)
: starting of Unix Epoch on January 1st, 1970 at UTC
FLOOR([reception_date] / (24*60*60))
: number of whole days
FLOOR( MOD([reception_date], 24*60*60) / (60*60) )
: hours
FLOOR( MOD([reception_date], 60*60) / 60 ),
: minutes
FLOOR( MOD([reception_date], 60) )
: seconds
CONCATENATE( <hours>, ":", <minutes>, ":", <seconds>)
: get a text representing the time
TIME()
: convert text to time
- "00:00:00"
: convert time to duration (this is a trick I learnt from @Steve here: TIME() | AppSheet Help Center)
I hope it can be helpfull for next creators.
that works thanks
User | Count |
---|---|
15 | |
15 | |
8 | |
7 | |
4 |