I am struggling to convert created_at and end_time to an actual date. This data was originally in json format but was able to parse out the majority of the data except for the dates. The date fields originally came in vstring format and I cannot seem to find a way to actually make it a date. Any insight would be greatly appreciated. I can include a copy of the workflow, if needed!
Thanks,
Michael
Solved! Go to Solution.
Would be you able to get the original format?
The time fields are in EPOCH time. This is number of seconds since 1970-01-01.
Apply this on those fields:
DATETIMEADD('1970-01-01 00:00:00',[created_at],'seconds')
I’m not on my computer so give the formula a shot and let me know!
After some research on the internet, I think this format of time is called Epoch & Unix Timestamp.
https://www.epochconverter.com/
Happy to help!
wonderful Explanation and it is really helpful.
Was wondering how json can be converted to normal dates and you just gave not only date but even minutes , seconds too.
Kudos to you!
Regards
JSON does not know anything about dates. What .NET does is a non-standard hack/extension. The problem with dates in JSON and really JavaScript in general – is that there's no equivalent literal representation for dates. In JavaScript following Date constructor straight away converts the milliseconds since 1970 to Date as follows:
var jsonDate = new Date(1297246301973);
Then let's convert it to js format:
var date = new Date(parseInt(jsonDate.substr(6)));
The substr() function takes out the /Date( part, and the parseInt() function gets the integer and ignores the )/ at the end. The resulting number is passed into the Date constructor .
User | Count |
---|---|
19 | |
15 | |
13 | |
9 | |
8 |