Is there a way i can subtract the hours and day at the same time at a one code? i have this my code but the hours only subtracts i have this error in the date of having 1900.
Okay if you need yesterday date and one hour before than current time then you can use this expression
AddHours(AddDays(CurrDateTime(), -1), -1)
Output -
The date picker input is SelectedDateTime(Date) and local variable is Dateset(datetime)Adding addhours() function 14 (put this in site property if it will change in future) hours as you need to set for 2PM
Hi @budang haba ,
Are you setting the StartDate3 value the first time or is it set with a value beforehand?
Thanks.
it is date time input field
Hello @budang haba
This expression will work and return time only, you can try it first by print somewhere in your screen or debug after assignment.
DateTimeToTime(AddDays(AddHours(CurrDateTime(), -1), -5))
But my question is that why you are subtracting days ?
AddHours(CurrDateTime(), -1) - it'll subtract 1 hour from current time. AddDays(AddHours(CurrDateTime(), -1), -5) - It'll subtract 5 days from current date.DateTimeToTime(AddDays(AddHours(CurrDateTime(), -1), -5)) - it'll return only time from date time.So no use of AddDays(AddHours(CurrDateTime(), -1), -5) expression.
ThanksDeep
i have to use subtracting the day and hours because i need a yesteday date function for the deadline function
Thanks man it actually worked but one thing that i forgot is there a way that i can lock my date picker in a specific time only ? like it will only be 2:00 PM?
Hello budang haba,If you convert date in hours and add only one thing, it will still work Example: 1 day = 24 hours, so accordingly, you are able to solve this in one stroke with the addhours function.Thanks and Regards,Akshay Deshpande
Do one thing: from date picker, pick only date not date time and on selection of datapicker action, set the time whatever you want (in data time variable)
how can i manually set it? sorry im a beginner here
it works man but how about the day? i want it to have yesterday's date
same 14-24 = i.e (-10) add -10 instead of 14 in above experssion
Okay thank you it worked