Hello,
Reading the json nfl data file, and one of the fields is the date and time of the game...
date : 2022-09-18T17:00Z
I used ABG's method to get the json item (list by walking key path), now I need to convert to an actual date instance.
Is there a way to convert this to an actual date / time instance, so I can format it the way I would like it displayed ?
In php I used
$format = 'D, F jS h:i a T'; // Thu, September 8th 8:20 PM EDT
$date = DateTimeImmutable::createFromFormat($format, $d);
$date->format('D-- h:i a')
to change the display format to Thu--8:20 pm
Is there a way to translate this to App Inventor ?
In Ai2, you can extract the year, month, date, hour, minute using the text segment block, since everything is fixed length.
The Clock component has a block to combine all that into an Instant, and blocks to format an Instant.
That Z at the end probably has something to do with time zones, if you want to gild the lily.
Thank you. Was being "lazy", was hoping could read from the text. But, I extracted the text and converted date and time to a clock instance, and all worked well.