Announcements
i know maybe my question so easy but i have utcdatetime control and i want use it to calculate and convert it to date type on my code
control name is (EmpStartDate) from type utcdatetime
so i write this but still give me error how can i convert that control from utcdatetime to date and here's my code
date startdate = EmpStartDate;
i did even this
date startdate = DateTimeUtil::date(EmpStartDate);
but i got this error
Argument 't' is incompatible with the required type.
*This post is locked for comments
thanks all for replays and those info all was really useful
Hi Mohammed,
Please refer this code:
utcdateTime testDonedateTime1; utcdateTime testDonedateTime; transdate tmpDate ; timeofday tmpTime; testDonedateTime1 = inventJournalTable.PostedDateTime; testDonedateTime = DateTimeUtil::applyTimeZoneOffset(testDonedateTime1, DateTimeUtil::getUserPreferredTimeZone()) tmpDate = DateTimeUtil::date(testDonedateTime); tmpTime = DateTimeUtil::time(testDonedateTime);
Important : utcDateTime control properties TimeZonePreference set No conversion
You need to understand what type of parameter values method accepts. EmpStartDate is your control not its value, so unless you pass value to date method you are not going to get results .
Another thing you are assigning control of datetime to date . Remove below line , its of no use
date startdate = EmpStartDate;
DateTimeUtil::date([utcDateTime]) will work. But did you notice that you are actually trying to assign the EmpStartDate control (an object of type FormDateControl) to your startDate variable. You should take the value from that control using EmpStartDate.dateValue().
André Arnaud de Cal...
294,060
Super User 2025 Season 1
Martin Dráb
232,858
Most Valuable Professional
nmaenpaa
101,158
Moderator