To the best of my learning `trandate` on a sales o...
# suitescript
s
To the best of my learning
trandate
on a sales order is just a date. In the XML it shows
<trandate>29-Jan-2025</trandate>
(noting that's my date format there) but a filter of
["trandate", "on", "29-Jan-2025"]
only matches the day before
28-Jan
. The various gpts I've tred basically say "Oh if you're in aanother timezone you have to work out what day it was in UTC and pass that". This is super weird and i'd love to find some docs which explain this properly - I think if you're in the US timezone this would always work because a date would always match UTC, but any timezones east of UTC would need this arbitrary adjustment right?
g
answered your stackoverflow query 🙂
s
Thanks 🙂 Although I still need an answer to what is the best way
g
try to use moment
s
Sorry i still don't understand. There is no date manipulation that would use moment.js. The date is a string when it is passed to the search.
e
Can you share the Suitelet code? Even though the value you're inspecting is a string, it's stored as a proper
Date
in the backend and will go through timezone conversion at some stage(s) of retrieval/display. The usual approach is to use the
N/format
module to translate to/from
Date
and
string
. Without your code, it's hard to be more specific.
s
Yeah i clearly need to set up a test script
Still learning netsuite but I have a rough plan to do that
m
@Si Hobbs can you put a snippet of the code? It's hard to help out without see the code.