Converting String ISO 8601 to Date and Time


#1

1) Give a description of the problem
Trying to convert from iso 8601 but the date part isn’t converting correctly. All I get back is today’s date. (Note: I am using the “if” statement because some of the dates are in YYYY-MM-DD format.)

2) What is the expected behaviour?
Properly convert the string in iso 8601 format into a date/time variable that is understood by webcore

3) What is happening/not happening?
The time part is converting properly but the date part is not

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
10/16/2019, 4:31:28 PM +423ms
+0ms ╔Received event [Home].test = 1571257888423 with a delay of 0ms
+232ms ║RunTime Analysis CS > 20ms > PS > 139ms > PE > 72ms > CE
+237ms ║Runtime (87710 bytes) successfully initialized in 139ms (v0.3.110.20191009) (235ms)
+238ms ║╔Execution stage started
+242ms ║║Cancelling statement #1’s schedules…
+246ms ║║Executed virtual command wait (1ms)
+247ms ║║Waiting for 1000ms
+1254ms ║║Sending external web request to: www.hebcal.com/hebcal/?v=1&cfg=json&year=now&month=now&maj=on&c=on&m=72&b=18&geo=zip&zip=11230
+1345ms ║║Executed virtual command httpRequest (92ms)
+1351ms ║║Executed virtual command setVariable (3ms)
+1365ms ║║30
+1366ms ║║Executed virtual command log (2ms)
+1373ms ║║Cancelling statement #102’s schedules…
+1378ms ║║0
+1379ms ║║Executed virtual command log (2ms)
+1391ms ║║Calculating (string) Date from without T + (string) 2019-10-01 >> (string) Date from without T 2019-10-01
+1395ms ║║Date from without T 2019-10-01
+1396ms ║║Executed virtual command log (2ms)
+1406ms ║║Time from without T is not given
+1407ms ║║Executed virtual command log (1ms)
+1413ms ║║Cancelling statement #102’s schedules…
+1419ms ║║1
+1420ms ║║Executed virtual command log (2ms)
+1438ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:49:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:49:00 PM EDT
+1442ms ║║Date from with T Wed, Oct 16 2019 @ 7:49:00 PM EDT
+1443ms ║║Executed virtual command log (2ms)
+1459ms ║║Calculating (string) Time from with T + (string) 7:49:00 PM EDT >> (string) Time from with T 7:49:00 PM EDT
+1463ms ║║Time from with T 7:49:00 PM EDT
+1464ms ║║Executed virtual command log (1ms)
+1469ms ║║Cancelling statement #102’s schedules…
+1474ms ║║2
+1475ms ║║Executed virtual command log (1ms)
+1493ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 6:14:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 6:14:00 PM EDT
+1497ms ║║Date from with T Wed, Oct 16 2019 @ 6:14:00 PM EDT
+1498ms ║║Executed virtual command log (2ms)
+1514ms ║║Calculating (string) Time from with T + (string) 6:14:00 PM EDT >> (string) Time from with T 6:14:00 PM EDT
+1517ms ║║Time from with T 6:14:00 PM EDT
+1518ms ║║Executed virtual command log (1ms)
+1524ms ║║Cancelling statement #102’s schedules…
+1530ms ║║3
+1531ms ║║Executed virtual command log (1ms)
+1548ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:43:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:43:00 PM EDT
+1553ms ║║Date from with T Wed, Oct 16 2019 @ 7:43:00 PM EDT
+1554ms ║║Executed virtual command log (3ms)
+1570ms ║║Calculating (string) Time from with T + (string) 7:43:00 PM EDT >> (string) Time from with T 7:43:00 PM EDT
+1574ms ║║Time from with T 7:43:00 PM EDT
+1575ms ║║Executed virtual command log (1ms)
+1580ms ║║Cancelling statement #102’s schedules…
+1585ms ║║4
+1586ms ║║Executed virtual command log (1ms)
+1598ms ║║Calculating (string) Date from without T + (string) 2019-10-08 >> (string) Date from without T 2019-10-08
+1601ms ║║Date from without T 2019-10-08
+1602ms ║║Executed virtual command log (1ms)
+1612ms ║║Time from without T is not given
+1613ms ║║Executed virtual command log (1ms)
+1619ms ║║Cancelling statement #102’s schedules…
+1625ms ║║5
+1626ms ║║Executed virtual command log (2ms)
+1643ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 6:08:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 6:08:00 PM EDT
+1646ms ║║Date from with T Wed, Oct 16 2019 @ 6:08:00 PM EDT
+1647ms ║║Executed virtual command log (1ms)
+1662ms ║║Calculating (string) Time from with T + (string) 6:08:00 PM EDT >> (string) Time from with T 6:08:00 PM EDT
+1666ms ║║Time from with T 6:08:00 PM EDT
+1667ms ║║Executed virtual command log (2ms)
+1672ms ║║Cancelling statement #102’s schedules…
+1677ms ║║6
+1678ms ║║Executed virtual command log (1ms)
+1690ms ║║Calculating (string) Date from without T + (string) 2019-10-09 >> (string) Date from without T 2019-10-09
+1694ms ║║Date from without T 2019-10-09
+1694ms ║║Executed virtual command log (1ms)
+1704ms ║║Time from without T is not given
+1705ms ║║Executed virtual command log (1ms)
+1711ms ║║Cancelling statement #102’s schedules…
+1716ms ║║7
+1717ms ║║Executed virtual command log (1ms)
+1735ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:36:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:36:00 PM EDT
+1738ms ║║Date from with T Wed, Oct 16 2019 @ 7:36:00 PM EDT
+1739ms ║║Executed virtual command log (1ms)
+1822ms ║║Calculating (string) Time from with T + (string) 7:36:00 PM EDT >> (string) Time from with T 7:36:00 PM EDT
+1825ms ║║Time from with T 7:36:00 PM EDT
+1826ms ║║Executed virtual command log (1ms)
+1832ms ║║Cancelling statement #102’s schedules…
+1837ms ║║8
+1838ms ║║Executed virtual command log (1ms)
+1856ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 6:03:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 6:03:00 PM EDT
+1860ms ║║Date from with T Wed, Oct 16 2019 @ 6:03:00 PM EDT
+1861ms ║║Executed virtual command log (1ms)
+1876ms ║║Calculating (string) Time from with T + (string) 6:03:00 PM EDT >> (string) Time from with T 6:03:00 PM EDT
+1880ms ║║Time from with T 6:03:00 PM EDT
+1881ms ║║Executed virtual command log (2ms)
+1886ms ║║Cancelling statement #102’s schedules…
+1892ms ║║9
+1893ms ║║Executed virtual command log (1ms)
+1910ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:31:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:31:00 PM EDT
+1914ms ║║Date from with T Wed, Oct 16 2019 @ 7:31:00 PM EDT
+1915ms ║║Executed virtual command log (2ms)
+1930ms ║║Calculating (string) Time from with T + (string) 7:31:00 PM EDT >> (string) Time from with T 7:31:00 PM EDT
+1934ms ║║Time from with T 7:31:00 PM EDT
+1934ms ║║Executed virtual command log (1ms)
+1940ms ║║Cancelling statement #102’s schedules…
+1945ms ║║10
+1946ms ║║Executed virtual command log (2ms)
+1957ms ║║Calculating (string) Date from without T + (string) 2019-10-13 >> (string) Date from without T 2019-10-13
+1961ms ║║Date from without T 2019-10-13
+1962ms ║║Executed virtual command log (2ms)
+1972ms ║║Time from without T is not given
+1973ms ║║Executed virtual command log (1ms)
+1979ms ║║Cancelling statement #102’s schedules…
+1984ms ║║11
+1985ms ║║Executed virtual command log (1ms)
+2003ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 6:00:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 6:00:00 PM EDT
+2007ms ║║Date from with T Wed, Oct 16 2019 @ 6:00:00 PM EDT
+2008ms ║║Executed virtual command log (1ms)
+2024ms ║║Calculating (string) Time from with T + (string) 6:00:00 PM EDT >> (string) Time from with T 6:00:00 PM EDT
+2027ms ║║Time from with T 6:00:00 PM EDT
+2028ms ║║Executed virtual command log (1ms)
+2034ms ║║Cancelling statement #102’s schedules…
+2039ms ║║12
+2040ms ║║Executed virtual command log (1ms)
+2052ms ║║Calculating (string) Date from without T + (string) 2019-10-14 >> (string) Date from without T 2019-10-14
+2056ms ║║Date from without T 2019-10-14
+2057ms ║║Executed virtual command log (2ms)
+2067ms ║║Time from without T is not given
+2068ms ║║Executed virtual command log (2ms)
+2073ms ║║Cancelling statement #102’s schedules…
+2079ms ║║13
+2080ms ║║Executed virtual command log (1ms)
+2098ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:28:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:28:00 PM EDT
+2102ms ║║Date from with T Wed, Oct 16 2019 @ 7:28:00 PM EDT
+2103ms ║║Executed virtual command log (2ms)
+2120ms ║║Calculating (string) Time from with T + (string) 7:28:00 PM EDT >> (string) Time from with T 7:28:00 PM EDT
+2124ms ║║Time from with T 7:28:00 PM EDT
+2125ms ║║Executed virtual command log (2ms)
+2131ms ║║Cancelling statement #102’s schedules…
+2137ms ║║14
+2138ms ║║Executed virtual command log (2ms)
+2151ms ║║Calculating (string) Date from without T + (string) 2019-10-15 >> (string) Date from without T 2019-10-15
+2155ms ║║Date from without T 2019-10-15
+2156ms ║║Executed virtual command log (1ms)
+2167ms ║║Time from without T is not given
+2168ms ║║Executed virtual command log (1ms)
+2173ms ║║Cancelling statement #102’s schedules…
+2179ms ║║15
+2180ms ║║Executed virtual command log (2ms)
+2198ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:27:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:27:00 PM EDT
+2201ms ║║Date from with T Wed, Oct 16 2019 @ 7:27:00 PM EDT
+2202ms ║║Executed virtual command log (1ms)
+2218ms ║║Calculating (string) Time from with T + (string) 7:27:00 PM EDT >> (string) Time from with T 7:27:00 PM EDT
+2222ms ║║Time from with T 7:27:00 PM EDT
+2223ms ║║Executed virtual command log (2ms)
+2229ms ║║Cancelling statement #102’s schedules…
+2234ms ║║16
+2235ms ║║Executed virtual command log (1ms)
+2248ms ║║Calculating (string) Date from without T + (string) 2019-10-16 >> (string) Date from without T 2019-10-16
+2252ms ║║Date from without T 2019-10-16
+2253ms ║║Executed virtual command log (1ms)
+2263ms ║║Time from without T is not given
+2264ms ║║Executed virtual command log (1ms)
+2270ms ║║Cancelling statement #102’s schedules…
+2276ms ║║17
+2277ms ║║Executed virtual command log (2ms)
+2294ms ║║Calculating (string) Date from without T + (string) 2019-10-17 >> (string) Date from without T 2019-10-17
+2297ms ║║Date from without T 2019-10-17
+2298ms ║║Executed virtual command log (1ms)
+2309ms ║║Time from without T is not given
+2310ms ║║Executed virtual command log (2ms)
+2315ms ║║Cancelling statement #102’s schedules…
+2321ms ║║18
+2322ms ║║Executed virtual command log (1ms)
+2333ms ║║Calculating (string) Date from without T + (string) 2019-10-18 >> (string) Date from without T 2019-10-18
+2336ms ║║Date from without T 2019-10-18
+2337ms ║║Executed virtual command log (1ms)
+2347ms ║║Time from without T is not given
+2348ms ║║Executed virtual command log (1ms)
+2354ms ║║Cancelling statement #102’s schedules…
+2359ms ║║19
+2361ms ║║Executed virtual command log (2ms)
+2379ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 5:52:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 5:52:00 PM EDT
+2382ms ║║Date from with T Wed, Oct 16 2019 @ 5:52:00 PM EDT
+2383ms ║║Executed virtual command log (1ms)
+2399ms ║║Calculating (string) Time from with T + (string) 5:52:00 PM EDT >> (string) Time from with T 5:52:00 PM EDT
+2403ms ║║Time from with T 5:52:00 PM EDT
+2404ms ║║Executed virtual command log (2ms)
+2409ms ║║Cancelling statement #102’s schedules…
+2415ms ║║20
+2416ms ║║Executed virtual command log (2ms)
+2428ms ║║Calculating (string) Date from without T + (string) 2019-10-19 >> (string) Date from without T 2019-10-19
+2431ms ║║Date from without T 2019-10-19
+2432ms ║║Executed virtual command log (1ms)
+2443ms ║║Time from without T is not given
+2444ms ║║Executed virtual command log (1ms)
+2449ms ║║Cancelling statement #102’s schedules…
+2454ms ║║21
+2455ms ║║Executed virtual command log (1ms)
+2472ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:21:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:21:00 PM EDT
+2476ms ║║Date from with T Wed, Oct 16 2019 @ 7:21:00 PM EDT
+2477ms ║║Executed virtual command log (2ms)
+2493ms ║║Calculating (string) Time from with T + (string) 7:21:00 PM EDT >> (string) Time from with T 7:21:00 PM EDT
+2497ms ║║Time from with T 7:21:00 PM EDT
+2498ms ║║Executed virtual command log (1ms)


#2

Note: I get the same exact error if I don’t have the “replace” function. The reason I tried with it is because someone on this forum mentioned it was necessary.

Here’s those logs and screenshot:


10/16/2019, 4:39:57 PM +499ms
+1ms ╔Received event [Home].test = 1571258397499 with a delay of 0ms
+220ms ║RunTime Analysis CS > 21ms > PS > 132ms > PE > 67ms > CE
+225ms ║Runtime (87475 bytes) successfully initialized in 132ms (v0.3.110.20191009) (223ms)
+227ms ║╔Execution stage started
+232ms ║║Cancelling statement #1’s schedules…
+235ms ║║Executed virtual command wait (0ms)
+236ms ║║Waiting for 1000ms
+1243ms ║║Sending external web request to: www.hebcal.com/hebcal/?v=1&cfg=json&year=now&month=now&maj=on&c=on&m=72&b=18&geo=zip&zip=11230
+1319ms ║║Executed virtual command httpRequest (77ms)
+1325ms ║║Executed virtual command setVariable (3ms)
+1339ms ║║30
+1340ms ║║Executed virtual command log (1ms)
+1347ms ║║Cancelling statement #102’s schedules…
+1352ms ║║0
+1353ms ║║Executed virtual command log (2ms)
+1364ms ║║Calculating (string) Date from without T + (string) 2019-10-01 >> (string) Date from without T 2019-10-01
+1368ms ║║Date from without T 2019-10-01
+1369ms ║║Executed virtual command log (1ms)
+1378ms ║║Time from without T is not given
+1379ms ║║Executed virtual command log (1ms)
+1384ms ║║Cancelling statement #102’s schedules…
+1390ms ║║1
+1391ms ║║Executed virtual command log (1ms)
+1404ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:49:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:49:00 PM EDT
+1408ms ║║Date from with T Wed, Oct 16 2019 @ 7:49:00 PM EDT
+1409ms ║║Executed virtual command log (2ms)
+1424ms ║║Calculating (string) Time from with T + (string) 7:49:00 PM EDT >> (string) Time from with T 7:49:00 PM EDT
+1427ms ║║Time from with T 7:49:00 PM EDT
+1428ms ║║Executed virtual command log (1ms)
+1433ms ║║Cancelling statement #102’s schedules…
+1439ms ║║2
+1440ms ║║Executed virtual command log (1ms)
+1453ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 6:14:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 6:14:00 PM EDT
+1459ms ║║Date from with T Wed, Oct 16 2019 @ 6:14:00 PM EDT
+1460ms ║║Executed virtual command log (3ms)
+1475ms ║║Calculating (string) Time from with T + (string) 6:14:00 PM EDT >> (string) Time from with T 6:14:00 PM EDT
+1479ms ║║Time from with T 6:14:00 PM EDT
+1480ms ║║Executed virtual command log (2ms)
+1485ms ║║Cancelling statement #102’s schedules…
+1490ms ║║3
+1491ms ║║Executed virtual command log (1ms)
+1505ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:43:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:43:00 PM EDT
+1509ms ║║Date from with T Wed, Oct 16 2019 @ 7:43:00 PM EDT
+1509ms ║║Executed virtual command log (1ms)
+1524ms ║║Calculating (string) Time from with T + (string) 7:43:00 PM EDT >> (string) Time from with T 7:43:00 PM EDT
+1528ms ║║Time from with T 7:43:00 PM EDT
+1529ms ║║Executed virtual command log (1ms)
+1534ms ║║Cancelling statement #102’s schedules…
+1539ms ║║4
+1540ms ║║Executed virtual command log (1ms)
+1551ms ║║Calculating (string) Date from without T + (string) 2019-10-08 >> (string) Date from without T 2019-10-08
+1555ms ║║Date from without T 2019-10-08
+1556ms ║║Executed virtual command log (1ms)
+1565ms ║║Time from without T is not given
+1566ms ║║Executed virtual command log (1ms)
+1571ms ║║Cancelling statement #102’s schedules…
+1577ms ║║5
+1578ms ║║Executed virtual command log (1ms)
+1591ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 6:08:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 6:08:00 PM EDT
+1595ms ║║Date from with T Wed, Oct 16 2019 @ 6:08:00 PM EDT
+1596ms ║║Executed virtual command log (1ms)
+1611ms ║║Calculating (string) Time from with T + (string) 6:08:00 PM EDT >> (string) Time from with T 6:08:00 PM EDT
+1614ms ║║Time from with T 6:08:00 PM EDT
+1615ms ║║Executed virtual command log (1ms)
+1620ms ║║Cancelling statement #102’s schedules…
+1626ms ║║6
+1626ms ║║Executed virtual command log (1ms)
+1638ms ║║Calculating (string) Date from without T + (string) 2019-10-09 >> (string) Date from without T 2019-10-09
+1641ms ║║Date from without T 2019-10-09
+1642ms ║║Executed virtual command log (1ms)
+1652ms ║║Time from without T is not given
+1653ms ║║Executed virtual command log (1ms)
+1658ms ║║Cancelling statement #102’s schedules…
+1663ms ║║7
+1664ms ║║Executed virtual command log (1ms)
+1678ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:36:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:36:00 PM EDT
+1681ms ║║Date from with T Wed, Oct 16 2019 @ 7:36:00 PM EDT
+1682ms ║║Executed virtual command log (1ms)
+1697ms ║║Calculating (string) Time from with T + (string) 7:36:00 PM EDT >> (string) Time from with T 7:36:00 PM EDT
+1700ms ║║Time from with T 7:36:00 PM EDT
+1701ms ║║Executed virtual command log (1ms)
+1707ms ║║Cancelling statement #102’s schedules…
+1712ms ║║8
+1713ms ║║Executed virtual command log (2ms)
+1727ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 6:03:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 6:03:00 PM EDT
+1730ms ║║Date from with T Wed, Oct 16 2019 @ 6:03:00 PM EDT
+1731ms ║║Executed virtual command log (2ms)
+1746ms ║║Calculating (string) Time from with T + (string) 6:03:00 PM EDT >> (string) Time from with T 6:03:00 PM EDT
+1749ms ║║Time from with T 6:03:00 PM EDT
+1750ms ║║Executed virtual command log (1ms)
+1756ms ║║Cancelling statement #102’s schedules…
+1762ms ║║9
+1763ms ║║Executed virtual command log (2ms)
+1777ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:31:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:31:00 PM EDT
+1780ms ║║Date from with T Wed, Oct 16 2019 @ 7:31:00 PM EDT
+1781ms ║║Executed virtual command log (1ms)
+1797ms ║║Calculating (string) Time from with T + (string) 7:31:00 PM EDT >> (string) Time from with T 7:31:00 PM EDT
+1801ms ║║Time from with T 7:31:00 PM EDT
+1802ms ║║Executed virtual command log (1ms)
+1807ms ║║Cancelling statement #102’s schedules…
+1812ms ║║10
+1813ms ║║Executed virtual command log (1ms)
+1825ms ║║Calculating (string) Date from without T + (string) 2019-10-13 >> (string) Date from without T 2019-10-13
+1828ms ║║Date from without T 2019-10-13
+1829ms ║║Executed virtual command log (1ms)
+1839ms ║║Time from without T is not given
+1840ms ║║Executed virtual command log (2ms)
+1845ms ║║Cancelling statement #102’s schedules…
+1850ms ║║11
+1851ms ║║Executed virtual command log (1ms)
+1867ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 6:00:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 6:00:00 PM EDT
+1871ms ║║Date from with T Wed, Oct 16 2019 @ 6:00:00 PM EDT
+1872ms ║║Executed virtual command log (1ms)
+1887ms ║║Calculating (string) Time from with T + (string) 6:00:00 PM EDT >> (string) Time from with T 6:00:00 PM EDT
+1891ms ║║Time from with T 6:00:00 PM EDT
+1892ms ║║Executed virtual command log (1ms)
+1897ms ║║Cancelling statement #102’s schedules…
+1902ms ║║12
+1903ms ║║Executed virtual command log (2ms)
+1915ms ║║Calculating (string) Date from without T + (string) 2019-10-14 >> (string) Date from without T 2019-10-14
+1918ms ║║Date from without T 2019-10-14
+1919ms ║║Executed virtual command log (1ms)
+1929ms ║║Time from without T is not given
+1930ms ║║Executed virtual command log (1ms)
+1935ms ║║Cancelling statement #102’s schedules…
+1940ms ║║13
+1941ms ║║Executed virtual command log (1ms)
+1955ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:28:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:28:00 PM EDT
+1958ms ║║Date from with T Wed, Oct 16 2019 @ 7:28:00 PM EDT
+1959ms ║║Executed virtual command log (1ms)
+1974ms ║║Calculating (string) Time from with T + (string) 7:28:00 PM EDT >> (string) Time from with T 7:28:00 PM EDT
+1978ms ║║Time from with T 7:28:00 PM EDT
+1979ms ║║Executed virtual command log (1ms)
+1984ms ║║Cancelling statement #102’s schedules…
+1989ms ║║14
+1990ms ║║Executed virtual command log (1ms)
+2001ms ║║Calculating (string) Date from without T + (string) 2019-10-15 >> (string) Date from without T 2019-10-15
+2005ms ║║Date from without T 2019-10-15
+2006ms ║║Executed virtual command log (2ms)
+2016ms ║║Time from without T is not given
+2017ms ║║Executed virtual command log (1ms)
+2022ms ║║Cancelling statement #102’s schedules…
+2027ms ║║15
+2028ms ║║Executed virtual command log (1ms)
+2043ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:27:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:27:00 PM EDT
+2046ms ║║Date from with T Wed, Oct 16 2019 @ 7:27:00 PM EDT
+2047ms ║║Executed virtual command log (1ms)
+2063ms ║║Calculating (string) Time from with T + (string) 7:27:00 PM EDT >> (string) Time from with T 7:27:00 PM EDT
+2067ms ║║Time from with T 7:27:00 PM EDT
+2068ms ║║Executed virtual command log (1ms)
+2073ms ║║Cancelling statement #102’s schedules…
+2078ms ║║16
+2079ms ║║Executed virtual command log (1ms)
+2091ms ║║Calculating (string) Date from without T + (string) 2019-10-16 >> (string) Date from without T 2019-10-16
+2095ms ║║Date from without T 2019-10-16
+2096ms ║║Executed virtual command log (2ms)
+2106ms ║║Time from without T is not given
+2107ms ║║Executed virtual command log (1ms)
+2113ms ║║Cancelling statement #102’s schedules…
+2118ms ║║17
+2119ms ║║Executed virtual command log (1ms)
+2131ms ║║Calculating (string) Date from without T + (string) 2019-10-17 >> (string) Date from without T 2019-10-17
+2135ms ║║Date from without T 2019-10-17
+2136ms ║║Executed virtual command log (2ms)
+2146ms ║║Time from without T is not given
+2147ms ║║Executed virtual command log (2ms)
+2152ms ║║Cancelling statement #102’s schedules…
+2158ms ║║18
+2159ms ║║Executed virtual command log (2ms)
+2171ms ║║Calculating (string) Date from without T + (string) 2019-10-18 >> (string) Date from without T 2019-10-18
+2174ms ║║Date from without T 2019-10-18
+2175ms ║║Executed virtual command log (1ms)
+2186ms ║║Time from without T is not given
+2187ms ║║Executed virtual command log (1ms)
+2192ms ║║Cancelling statement #102’s schedules…
+2198ms ║║19
+2199ms ║║Executed virtual command log (1ms)
+2214ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 5:52:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 5:52:00 PM EDT
+2218ms ║║Date from with T Wed, Oct 16 2019 @ 5:52:00 PM EDT
+2219ms ║║Executed virtual command log (2ms)
+2234ms ║║Calculating (string) Time from with T + (string) 5:52:00 PM EDT >> (string) Time from with T 5:52:00 PM EDT
+2238ms ║║Time from with T 5:52:00 PM EDT
+2239ms ║║Executed virtual command log (2ms)
+2244ms ║║Cancelling statement #102’s schedules…
+2250ms ║║20
+2251ms ║║Executed virtual command log (2ms)
+2263ms ║║Calculating (string) Date from without T + (string) 2019-10-19 >> (string) Date from without T 2019-10-19
+2267ms ║║Date from without T 2019-10-19
+2268ms ║║Executed virtual command log (1ms)
+2278ms ║║Time from without T is not given
+2279ms ║║Executed virtual command log (2ms)
+2284ms ║║Cancelling statement #102’s schedules…
+2290ms ║║21
+2291ms ║║Executed virtual command log (2ms)
+2305ms ║║Calculating (string) Date from with T + (string) Wed, Oct 16 2019 @ 7:21:00 PM EDT >> (string) Date from with T Wed, Oct 16 2019 @ 7:21:00 PM EDT
+2309ms ║║Date from with T Wed, Oct 16 2019 @ 7:21:00 PM EDT
+2310ms ║║Executed virtual command log (2ms)
+2326ms ║║Calculating (string) Time from with T + (string) 7:21:00 PM EDT >> (string) Time from with T 7:21:00 PM EDT
+2329ms ║║Time from with T 7:21:00 PM EDT
+2330ms ║║Executed virtual command log (1ms)


#3

I forgot to log the json data for “$response.items.date” so here is it for reference:


#4

I really believe you have to stop using the syntax $response.items[$index].date. As far as I can tell it is not working for you. Instead use arrayItem($index,hebcal_date). You have already shown hebcal_date has the right data in it. Your for loop should be from 0 to count(hebcal_date)-1 step 1.


#5

I modified per my suggestion

and got the following log:

10/16/2019, 2:18:30 PM +407ms
+1404ms	║30
+1410ms	║[2019-10-01, 2019-10-01T19:49:00-04:00, 2019-10-04T18:14:00-04:00, 2019-10-05T19:43:00-04:00, 2019-10-08, 2019-10-08T18:08:00-04:00, 2019-10-09, 2019-10-09T19:36:00-04:00, 2019-10-11T18:03:00-04:00, 2019-10-12T19:31:00-04:00, 2019-10-13, 2019-10-13T18:00:00-04:00, 2019-10-14, 2019-10-14T19:28:00-04:00, 2019-10-15, 2019-10-15T19:27:00-04:00, 2019-10-16, 2019-10-17, 2019-10-18, 2019-10-18T17:52:00-04:00, 2019-10-19, 2019-10-19T19:21:00-04:00, 2019-10-20, 2019-10-20T17:49:00-04:00, 2019-10-21, 2019-10-21T19:18:00-04:00, 2019-10-22, 2019-10-22T19:17:00-04:00, 2019-10-25T17:43:00-04:00, 2019-10-26T19:11:00-04:00]
+1434ms	║0
+1454ms	║Date from without T 2019-10-01
+1467ms	║Time from without T is not given
+1489ms	║1
+1512ms	║Date from with T Wed, Oct 16 2019 @ 7:49:00 PM PDT
+1536ms	║Time from with T 7:49:00 PM PDT
+1559ms	║2
+1581ms	║Date from with T Wed, Oct 16 2019 @ 6:14:00 PM PDT
+1604ms	║Time from with T 6:14:00 PM PDT
+1628ms	║3
+1652ms	║Date from with T Wed, Oct 16 2019 @ 7:43:00 PM PDT
+1677ms	║Time from with T 7:43:00 PM PDT
+1700ms	║4
+1720ms	║Date from without T 2019-10-08
+1733ms	║Time from without T is not given
+1758ms	║5
+1780ms	║Date from with T Wed, Oct 16 2019 @ 6:08:00 PM PDT
+1805ms	║Time from with T 6:08:00 PM PDT
+1828ms	║6
+1847ms	║Date from without T 2019-10-09
+1861ms	║Time from without T is not given
+1884ms	║7
+1907ms	║Date from with T Wed, Oct 16 2019 @ 7:36:00 PM PDT
+1930ms	║Time from with T 7:36:00 PM PDT
+1953ms	║8
+1975ms	║Date from with T Wed, Oct 16 2019 @ 6:03:00 PM PDT
+1998ms	║Time from with T 6:03:00 PM PDT
+2020ms	║9
+2042ms	║Date from with T Wed, Oct 16 2019 @ 7:31:00 PM PDT
+2064ms	║Time from with T 7:31:00 PM PDT
+2087ms	║10
+2106ms	║Date from without T 2019-10-13
+2119ms	║Time from without T is not given
+2141ms	║11
+2163ms	║Date from with T Wed, Oct 16 2019 @ 6:00:00 PM PDT
+2187ms	║Time from with T 6:00:00 PM PDT
+2212ms	║12
+2231ms	║Date from without T 2019-10-14
+2244ms	║Time from without T is not given
+2268ms	║13
+2290ms	║Date from with T Wed, Oct 16 2019 @ 7:28:00 PM PDT
+2313ms	║Time from with T 7:28:00 PM PDT
+2336ms	║14
+2355ms	║Date from without T 2019-10-15
+2368ms	║Time from without T is not given
+2391ms	║15
+2413ms	║Date from with T Wed, Oct 16 2019 @ 7:27:00 PM PDT
+2436ms	║Time from with T 7:27:00 PM PDT
+2459ms	║16
+2478ms	║Date from without T 2019-10-16
+2490ms	║Time from without T is not given
+2513ms	║17
+2533ms	║Date from without T 2019-10-17
+2546ms	║Time from without T is not given
+2569ms	║18
+2588ms	║Date from without T 2019-10-18
+2600ms	║Time from without T is not given
+2623ms	║19
+2645ms	║Date from with T Wed, Oct 16 2019 @ 5:52:00 PM PDT
+2668ms	║Time from with T 5:52:00 PM PDT
+2690ms	║20
+2709ms	║Date from without T 2019-10-19
+2721ms	║Time from without T is not given
+2744ms	║21
+2765ms	║Date from with T Wed, Oct 16 2019 @ 7:21:00 PM PDT
+2788ms	║Time from with T 7:21:00 PM PDT
+2812ms	║22
+2831ms	║Date from without T 2019-10-20
+2843ms	║Time from without T is not given
+2867ms	║23
+2890ms	║Date from with T Wed, Oct 16 2019 @ 5:49:00 PM PDT
+2913ms	║Time from with T 5:49:00 PM PDT
+2936ms	║24
+2956ms	║Date from without T 2019-10-21
+2968ms	║Time from without T is not given
+2991ms	║25
+3014ms	║Date from with T Wed, Oct 16 2019 @ 7:18:00 PM PDT
+3038ms	║Time from with T 7:18:00 PM PDT
+3060ms	║26
+3079ms	║Date from without T 2019-10-22
+3092ms	║Time from without T is not given
+3115ms	║27
+3138ms	║Date from with T Wed, Oct 16 2019 @ 7:17:00 PM PDT
+3162ms	║Time from with T 7:17:00 PM PDT
+3186ms	║28
+3209ms	║Date from with T Wed, Oct 16 2019 @ 5:43:00 PM PDT
+3233ms	║Time from with T 5:43:00 PM PDT
+3256ms	║29
+3277ms	║Date from with T Wed, Oct 16 2019 @ 7:11:00 PM PDT
+3304ms	║Time from with T 7:11:00 PM PDT

#6

I just find it easier to use that syntax (it’s more straightforward). Anyway it doesn’t make a difference here they both get the same results.

Compare my log to yours. We both got the same exact things.

Think about it $index = 1 should get a date of 10/01/2019 instead we keep getting today’s date (10/16/2019)


#7

Yep, my bad. Didn’t look close enough at all the data. Turns out datetime() can’t handle the format of your data. It only works with ‘/’ and not ‘-’. Noticed you tried this before but you also have to remove the time for it to recognize as a valid date. Couldn’t figure out how to convert the entire date and time but this appears to get what you want.

producing this log:

10/17/2019, 1:19:30 AM +961ms
+1385ms	║30
+1392ms	║[2019-10-01, 2019-10-01T19:49:00-04:00, 2019-10-04T18:14:00-04:00, 2019-10-05T19:43:00-04:00, 2019-10-08, 2019-10-08T18:08:00-04:00, 2019-10-09, 2019-10-09T19:36:00-04:00, 2019-10-11T18:03:00-04:00, 2019-10-12T19:31:00-04:00, 2019-10-13, 2019-10-13T18:00:00-04:00, 2019-10-14, 2019-10-14T19:28:00-04:00, 2019-10-15, 2019-10-15T19:27:00-04:00, 2019-10-16, 2019-10-17, 2019-10-18, 2019-10-18T17:52:00-04:00, 2019-10-19, 2019-10-19T19:21:00-04:00, 2019-10-20, 2019-10-20T17:49:00-04:00, 2019-10-21, 2019-10-21T19:18:00-04:00, 2019-10-22, 2019-10-22T19:17:00-04:00, 2019-10-25T17:43:00-04:00, 2019-10-26T19:11:00-04:00]
+1420ms	║0
+1465ms	║Date from without T Tue, Oct 1 2019
+1477ms	║Time from without T is not given
+1504ms	║1
+1548ms	║Date from with T Tue, Oct 1 2019
+1569ms	║Time from with T 7:49:00 PM PDT
+1596ms	║2
+1638ms	║Date from with T Fri, Oct 4 2019
+1660ms	║Time from with T 6:14:00 PM PDT
+1686ms	║3
+1730ms	║Date from with T Sat, Oct 5 2019
+1753ms	║Time from with T 7:43:00 PM PDT
+1780ms	║4
+1825ms	║Date from without T Tue, Oct 8 2019
+1843ms	║Time from without T is not given
+1872ms	║5
+1916ms	║Date from with T Tue, Oct 8 2019
+1938ms	║Time from with T 6:08:00 PM PDT
+1965ms	║6
+2009ms	║Date from without T Wed, Oct 9 2019
+2021ms	║Time from without T is not given
+2047ms	║7
+2093ms	║Date from with T Wed, Oct 9 2019
+2114ms	║Time from with T 7:36:00 PM PDT
+2142ms	║8
+2186ms	║Date from with T Fri, Oct 11 2019
+2207ms	║Time from with T 6:03:00 PM PDT
+2234ms	║9
+2278ms	║Date from with T Sat, Oct 12 2019
+2300ms	║Time from with T 7:31:00 PM PDT
+2327ms	║10
+2372ms	║Date from without T Sun, Oct 13 2019
+2384ms	║Time from without T is not given
+2414ms	║11
+2463ms	║Date from with T Sun, Oct 13 2019
+2484ms	║Time from with T 6:00:00 PM PDT
+2510ms	║12
+2556ms	║Date from without T Mon, Oct 14 2019
+2568ms	║Time from without T is not given
+2592ms	║13
+2637ms	║Date from with T Mon, Oct 14 2019
+2659ms	║Time from with T 7:28:00 PM PDT
+2685ms	║14
+2731ms	║Date from without T Tue, Oct 15 2019
+2743ms	║Time from without T is not given
+2769ms	║15
+2812ms	║Date from with T Tue, Oct 15 2019
+2835ms	║Time from with T 7:27:00 PM PDT
+2861ms	║16
+2905ms	║Date from without T Wed, Oct 16 2019
+2918ms	║Time from without T is not given
+2944ms	║17
+2989ms	║Date from without T Thu, Oct 17 2019
+3002ms	║Time from without T is not given
+3029ms	║18
+3073ms	║Date from without T Fri, Oct 18 2019
+3085ms	║Time from without T is not given
+3112ms	║19
+3155ms	║Date from with T Fri, Oct 18 2019
+3178ms	║Time from with T 5:52:00 PM PDT
+3204ms	║20
+3249ms	║Date from without T Sat, Oct 19 2019
+3261ms	║Time from without T is not given
+3287ms	║21
+3332ms	║Date from with T Sat, Oct 19 2019
+3355ms	║Time from with T 7:21:00 PM PDT
+3379ms	║22
+3424ms	║Date from without T Sun, Oct 20 2019
+3436ms	║Time from without T is not given
+3462ms	║23
+3507ms	║Date from with T Sun, Oct 20 2019
+3530ms	║Time from with T 5:49:00 PM PDT
+3558ms	║24
+3607ms	║Date from without T Mon, Oct 21 2019
+3620ms	║Time from without T is not given
+3646ms	║25
+3689ms	║Date from with T Mon, Oct 21 2019
+3712ms	║Time from with T 7:18:00 PM PDT
+3829ms	║26
+3873ms	║Date from without T Tue, Oct 22 2019
+3886ms	║Time from without T is not given
+3912ms	║27
+3957ms	║Date from with T Tue, Oct 22 2019
+3979ms	║Time from with T 7:17:00 PM PDT
+4005ms	║28
+4049ms	║Date from with T Fri, Oct 25 2019
+4071ms	║Time from with T 5:43:00 PM PDT
+4097ms	║29
+4148ms	║Date from with T Sat, Oct 26 2019
+4171ms	║Time from with T 7:11:00 PM PDT

I think this is what you were after. Hope it helps.


Rocket Launch Notifications via API
#8

FYI @shmuelsash, I think you can just replace the indexOf(…) with ‘10’ since the date has a fixed width.


#9

Just a warning… arrayItem is very different from the $response.items[$index].date format, I strongly discourage using it. Quite a misnomer, arrayItem is actually meant to operate on arguments, like this: arrayItem(2, 'a', 'b', 'c', 'd') which returns 'c'. It has a mode to support two arguments, an index and an array, but it does not work how you expect.

When given an array, arrayItem converts it to text, splits that text into an array at each comma, then gives the item at that index in the new array. The simplest example where this is a terrible idea is an array cities = ['Boulder, Colorado', 'New York']. Pass that in to arrayItem(1, cities) and you get "Colorado" rather than "New York"… oops. Give it numbers = [1, 2, 3] and with arrayItem(1, numbers) you get the text "2" rather than a number 2.

Extrapolate that out to a $response and the array may have nested arrays, objects, text with commas… you just don’t know what you’re going to get.

The one case where arrayItem should be used is if you can guarantee that the values will not have commas and you need to calculate the index with a formula. For example arrayItem($index - 1, values) will work but $response.data[$index - 1] does not since that only supports a single value, not an expression. If you do need the array format just store $index - 1 to another variable and then use that variable in the $response.data[myIndex].