S.K.

unread,
Oct 3, 2016, 11:32:42 AM10/3/16
to MIT App Inventor Forum

Hello,
i need some help for MEL Calculator. The problem is to get the UTC Time and Date and aslo to calculate 3/10/120 days up to the Date.
for example the current date is 03.10.2016 and in 3 Days the result is the 06.10.2016 and in 10 Days 13.10.2016 and the same with 120 Days.

Thank you for your help

Italo

unread,
Oct 3, 2016, 12:18:23 PM10/3/16
to MIT App Inventor Forum

Have you seen these blocks?
For current UTC time you can use a free API like http://www.timeapi.org/


Abraham Getzler

unread,
Oct 4, 2016, 8:28:32 PM10/4/16
to MIT App Inventor Forum
This link might help ...

Format Z gives you the time zone, and from there you can get UTC.

ABG

S.K.

unread,
Oct 6, 2016, 2:51:08 PM10/6/16
to MIT App Inventor Forum
Thanks 

the Day calculation works fine but i have some problems to get the UTC Time with Z. See on Top 2 Blokcs.

S.K.

unread,
Oct 6, 2016, 3:36:56 PM10/6/16
to MIT App Inventor Forum


Abraham Getzler

unread,
Oct 6, 2016, 7:19:21 PM10/6/16
to MIT App Inventor Forum
I had to go into my emulator's settings and set its time zone manually to EST to get these results ...

The format Z returned -400 for EST, so to get my UTC of 11 PM from my EST of 7 PM I have to add 4 hours.

To cut off the 00 and reverse the sign, divide by -100 and add it to the current hour?

ABG
Do Its.png
2016-10-06 19_13_21-UTC vs GMT - Google Search.png

Abraham Getzler

unread,
Oct 6, 2016, 8:57:42 PM10/6/16
to MIT App Inventor Forum
Reply all
Reply to author
Forward
0 new messages