Axapta: Convert utcDateTime to date

坚强是说给别人听的谎言 提交于 2019-12-06 09:52:50

The DateTimeUtil Class has methods for dealing with utcdatetime variables. In your case you would use DateTimeUtil::date.

timeDiff = Global::yearDiff(_now, DateTimeUtil::date(_myTable.myUTCDateTime));
Arpan Sen

Logic for utcdatetime :

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

utcDateTime         _dateTime = 2012-12-31T13:59:58;
date                _date;
;

_date = DateTimeUtil::date(_dateTime);
info(strFmt('%1',_date));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!