Hey There: anyone has done converting Shopify crea...
# suitescript
k
Hey There: anyone has done converting Shopify created at date
2022-02-03T12:29:33-08:00
to NetSuite format (Date/time)
b
use suitescript 2.1
and simply put that string into the Date constructor
k
I have script that constructed in 2.0
b
then you get to use moment timezone
k
can't we do in N/format using ?
b
N/format is for strings that match a format that netsuite uses
netsuite date time strings arent in that format
k
Updating thread for other People to parse shopify date using following function var x = format.parse({     value: new Date('2021-09-10T093121-07:00'),     type: format.Type.DATETIMETZ   });
b
you dont actually need format.parse
format.parse would turn a string into a Date, and you already have a Date
when you toss invalid inputs into format.parse, it just returns the value you input, which in this case is simply
Copy code
new Date('2021-09-10T09:31:21-07:00')