and more in a single search tool across platforms. Read the announcement here. |
03/12/2024 08:58 AM
Hi,
In the Create/update user request form validation for date field, we need to compare user start date with the current date. But the user's start date is in EST and the current date reference variable 'currentdate' available for validations is in UTC. Is there any way to convert the time zone for either of the dates to make a valid comparison? Or is there any other current date reference variable available for validations that provides the date/time in local time zone?
Solved! Go to Solution.
03/12/2024 10:12 AM
you can use below
DATEDIFF(user.STARTDATE, CURDATE())
03/13/2024 02:24 PM
Hi Raghu,
It is erroring out when tried as a validation condition. I think MySql syntax will not work in form validations. It is all groovy.
Regards
03/13/2024 03:06 PM
${(Date.parse("yyyy-MM-dd", orgenddate) >= enddate) && (enddate >=(startdate))}
03/14/2024 09:19 AM
Hi Rishikesh,
Thanks for sharing the code and the link. The issue there is about parsing the string to date. But in our case, we are looking for options to get the current date in local time zone and not in UTC.
Regards
Jyostna Yarlagadda
03/12/2024 10:19 AM
It will validate against UTC only
03/14/2024 07:45 PM
I am able to derive the local/EST current date by using the code below in the form field validation where I need to restrict back-dated hires:
${hiredate-Date.parse("yyyy-MM-dd hh:mm:ss",new Date().format('yyyy-MM-dd hh:mm:ss',TimeZone.getTimeZone('EST'))) >= 0}
Thank for providing valuable suggestions!
Regards
Jyostna Yarlagadda