Date Time UTC storing issue

Hi, I am working on a delegate/backup functionality in my application where the user can select the start and end date and its gets stored in database in UTC. But the system is storing the dates from midnight start date UTC to midnight end date UTC. Ex. If a user selects Start Date – 5th July UTC and End Date – 7th July UTC then system makes the user delegate from midnight 5th July UTC till midnight 7th July UTC due which the user is no longer a delegate on 7 July since midnight 7 July already has passed. But I want the user to be a delegate of primary user till end of 7th July as user has selected End Date as 7th July so he should be a delegate of primary user till 7th July ends. But since the end date is getting stored as midnight 7th July so the user is not able to serve as a delegate of primary user on 7th July.  And in Xpath I am using the below condition to check if the user is still a delegate or not so that he could see the primary user request:       startDate <= '[%CurrentDateTime%]'       and       endDate >= '[%CurrentDateTime%]']  So the system compares date and time both (ex. it is comparing as 7th July 1:00 AM >= 7th July 00:00 AM) which is true so the user no longer a delegate but i want the the user to be a delegate till whole 7th July as well. So if anyone can help on this. 
2 answers

For XPath you also have these tokens to use:

Look at the [%BeginOfCurrentDayUTC%] and [%EndOfCurrentDayUTC%]. Do note that you need to decide which day you are going to use. Does the timezone of the user have to be taken into account? If not make sure that localize is set to off in your domain model. Otherwise you need the non UTC versions of these tokens.





You should use [%BeginOfCurrentDay%], see the doc here

(and see the response of Ronald here :