DateTime variables are not using Time part when passed as SQL parameter
Posted: Tue Apr 07, 2026 1:29 pm
We have report with dateto, datefrom variables created with type "datetime" and allowed to use as an SQL parameter. Recently report writers complained that even if they pass variable with time - time is not used properly in SQL. During debugging I've found out that even if you pass variable value as "06/02/2024 07:00:00 AM" for example - it will end up using "Set variable: datfrom, value: 06/01/2024 12:00:00 AM"
During debugging I've found out that the main issue is most likely with com.stimulsoft.base.system.StiDateTime#fromString method - it goes first through array list of COMMON_FORMATS which starts with "MM/dd/yyyy" - this function expects this format to fail with expection during parsing, but it parses the date part correctly and gets rid of time part so we end up with 12:00AM by default always. We've tried to change value format to "2024-06-01T07:00:00.00Z" format - but it doesn't work either. During debug I see that first time it actually parsed correctly with time, but stored in US format "MM/dd/yyyy" by default. Then during rendering this function is called subsequently again still cutting off the time part due to the same issue.
We're using the latest available version 2026.1.6 and issue still there. Looking forward to fast fix or at least a workaround if possible.
During debugging I've found out that the main issue is most likely with com.stimulsoft.base.system.StiDateTime#fromString method - it goes first through array list of COMMON_FORMATS which starts with "MM/dd/yyyy" - this function expects this format to fail with expection during parsing, but it parses the date part correctly and gets rid of time part so we end up with 12:00AM by default always. We've tried to change value format to "2024-06-01T07:00:00.00Z" format - but it doesn't work either. During debug I see that first time it actually parsed correctly with time, but stored in US format "MM/dd/yyyy" by default. Then during rendering this function is called subsequently again still cutting off the time part due to the same issue.
We're using the latest available version 2026.1.6 and issue still there. Looking forward to fast fix or at least a workaround if possible.