How can I create datetime in particular time zone in Appian ?

My Appian Timezone is set to Pacific time

Below functions are returning correct time

now()  -   2/20/2023 5:40 AM PST

datetime(year(now()),month(now()),day(now()),hour(now()),minute(now()))   -  2/20/2023 5:40 AM PST

However, when I try to create datetime where I want to change the date and time acc to my preference, the timezone offset gets added. 

datetime(year(now()),month(now()),day(now()),0,0) – 2/19/2023 4:00 PM PST  

I want the output as - 2/20/2023 12:00 AM PST

 

 

 

Requirement for which I want to create datetime in specific timezone.

Now I want to create a datetime so that I can use it to filter the datetime column stored in DB

I need to fetch all rows from DB where the createdDate is say 2/20/2023 so for that I thought of creating a query filter as

Date between (2/20/2023 12:0AM PST and 2/20/2023 11:59 PM PST).

However I am unable to create datetime in particular time zone

 

  Discussion posts and replies are publicly visible

  • datetime(year(now()),month(now()),day(now()),0,0) - you can wrap this inside gmt() and it will give you the output you are looking for. 

  • 0
    Certified Lead Developer

    I just wrote a blog post about this. Find it here: appian.rocks/.../

  • The Date and Time Functions gmt(), local(), now(), and today() and functions that cast a date and time value to a string of text (such as the tostring() and text() functions) use one of the process time zone contexts and take the user's time zone when the functions are evaluated in a process.
    The timezone process property returns the time zone ID currently used by a process instance (its context).
    The Due Today filter (on the Filter tab of the Reports view) uses the context time zone to determine today and whether the deadlines for tasks and processes fall within that day for the user viewing the report.
    Notifications with expressions evaluated in the body have those expressions evaluated as part of the context flow before the data is sent to notifications. These expressions are evaluated using the context time zone.
    Calendar expression functions (those starting with cal*) do not use the time zone context. They operate based on the calendar time zone.

    Regards,

    Rachel Gomez