Is it true that when running a saved search from a...
# suitescript
b
Is it true that when running a saved search from a Scheduled Script on a OneWorld account, the date filters and results are interpreted in the parent subsidiary's time zone? Context: I work for an organization in CT (Chicago) time zone, but their parent subsidiary is configured in CET (Europe/Amsterdam) time zone, and I'm getting unexpected search results. I'm using a relative
on or after x days ago
filter. How do I fix this? Load the search, calculate the date-time for the filters and then add them through script?
b
its more nuanced than that, if your script is running as the system user, then it uses the parent subsidiary's timezone
1
👀 1
there are ways to run the script using different users, for example it runs using the current user if using N/task
that said, the days ago filter is a date filter, which doesnt actually use the time component
🤔 1
👀 1
b
@battk Thanks for the input. I'm filtering on
datecreated
- won't the date depend on the time zone then? I think I'd have the same issue with the
hours ago
filter.
b
it does, date created is a datetime
so its value will change depending on your user's timezone
the days ago filter is a date filter, which means that the time component is ignored