raghav
04/11/2024, 3:31 PMAnthony Nooren
04/11/2024, 3:56 PMSELECT
TO_CHAR(current_timestamp at time zone 'US/Eastern', 'YYYY-MM-DD HH:MI:SS' ),
TO_CHAR(current_timestamp, 'YYYY-MM-DD HH:MI:SS' )
FROM
dual
The following resource has a lot of info on dates: https://timdietrich.me/blog/netsuite-suiteql-dates-times/Shai Coleman
04/12/2024, 8:50 AMUNEXPECTED_ERROR
when running through the SuiteQL REST API. It works fine through the SuiteQL Query Tool.
The workaround is to use some function around the timezone string, e.g.
SELECT TO_CHAR(current_timestamp AT TIME ZONE TO_CHAR('US/Eastern'), 'YYYY-MM-DD HH:MI:SS') FROM DUAL
Alternatively, you can convert it to UTC, and then convert it to the correct timezone outside SuiteQL, e.g.
SELECT to_char(sys_extract_utc(systimestamp), 'YYYY-MM-DD"T"HH24:MI:SS"Z"')
raghav
04/12/2024, 12:31 PMSELECT
TO_CHAR(soTrans.createddate at time zone 'US/Eastern', 'YYYY-MM-DD HH:MI:SS' )
FROM
transaction AS soTrans
WHERE
soTrans.id IN (13108776)
raghav
04/12/2024, 12:53 PMTo_char(sys_extract_utc(soTrans.createddate) at time zone 'US/Eastern', 'MM/DD/YYYY HH24:MI:SS')
Thanks both of you.