Convert epoch date/time values to milliseconds

78 views
Skip to first unread message

Scott Ferguson

unread,
Sep 27, 2015, 9:22:36 PM9/27/15
to MIT App Inventor Forum
If data that your app is processing contains date/time values as epoch values (10-digit seconds elapsed since January 1, 1970) then it is easy to convert that to milliseconds:

Here is some sample data containing epoch date-time values:

...Inbound","sch_arr_dt":"1443402660","sch_dep_dt":"1443402660","pre_dt":"1443403140","...

All that is needed is to multiply the value by 1000 to convert it to milliseconds, then use the MakeInstantFromMillis procedure with result:

Here is an example:

Once the value is an instant, the Clock component blocks can use that value.

---
sf
Reply all
Reply to author
Forward
0 new messages