Home Discussions Questions & Answers Handling Timezone in Blitz Report Date Parameters

Handling Timezone in Blitz Report Date Parameters

Avatar photoCustomer December 6, 2021 at 3:53 am

My report uses a ‘Date’ parameter to capture the transaction date. If the user enters ‘2025-01-01’, and we have timezone conversions enabled, is this value adjusted to the server’s time before being bound to the SQL query?

Viewing 6 reply threads
  • Author
    Replies
    • Support December 7, 2021 at 1:29 am  

      No, if the parameter type is set to Date, even if timezone conversions are enabled globally, the entered parameter value (e.g., ‘2025-01-01’) is used as a bind variable for SQL execution without any conversion . It is effectively bound as midnight of the date entered .

    • Avatar photoCustomer December 9, 2021 at 4:22 am  

      If I need the value to include the time and be converted to the server’s timezone, which parameter type should I use, and how does the conversion work?

    • Support December 9, 2021 at 4:16 pm  

      If you need the time component and desire server timezone conversion, you must use the ‘DateTime’ parameter type . If timezone conversions are enabled, the entered parameter value is automatically converted to the server time before it is used as a bind variable in the execution SQL .

    • Avatar photoCustomer December 10, 2021 at 10:38 pm  

      If I need to manually test how a specific date/time string is converted to the server time, is there a utility function I can use in SQL Developer?

    • Support December 12, 2021 at 1:31 pm  

      Yes, you can use the utility function `XXEN_UTIL.SERVER_TIME` . This function takes a date input and returns the converted server time . For example, `select to_char(xxen_util.server_time(to_date(‘2020.09.03 09:00:00’, ‘YYYY.MM.DD HH24:Mi:Ss’)), ‘YYYY.MM.DD HH24:Mi:Ss’) from dual` can be used to check the resulting server time format .

    • Avatar photoCustomer December 14, 2021 at 12:29 am  

      If the date parameter is defined with an LOV, does selecting a value from the LOV enforce validation?

    • Support December 15, 2021 at 5:21 am  

      Yes, if the parameter type is set to ‘LOV’ or ‘LOV custom’, selecting one of these types automatically controls the validation of parameter values at run-time . This ensures that the user is selecting a valid, pre-defined value based on the LOV query .

Viewing 6 reply threads
  • You must be logged in to reply to this post.

Login with: