convert utcdatetime to string
static void JobEF_DateTimeToString(Args _args)
{
utcDateTime myDate = DateTimeUtil::getSystemDateTime();
//OPTION1:
info(DateTimeUtil::toStr(myDate));
//OPTION2:
info(DateEffectivenessCheck::queryDate(myDate));
}
convert System.DateTime to utcdatetime
static void JobEF_DateTimeToUtcDatetime(Args _args)
{
System.DateTime date1 = System.DateTime::get_Now();
//OPTION1:
utcdatetime date2 = CLRInterop::getAnyTypeForObject(date1);
//OPTION2 (behind the scene, does the same as the above). better use this
utcdatetime date3 = Global::clrSystemDateTime2UtcDateTime(date1);
info(strFmt('%1', date2));
info(strFmt('%1', date3));
}
No comments:
Post a Comment