Thursday, 9 January 2014

TimeConversion in ax 2009

public static void TimeConversion()
{
    UTCDateTime dateTime;
    date tmpDate;
    TimeOfDay tmpTime;
    CustTable cTable = CustTable::find("1101");
    ;
    dateTime = cTable.createdDateTime;
    tmpTime = DateTimeUtil::time(DateTimeUtil::applyTimeZoneOffset(dateTime, DateTimeUtil::getUserPreferredTimeZone()));
    dateTime = DateTimeUtil::newDateTime(12\05\2010, timeNow());
    tmpTime  = DateTimeUtil::time(dateTime);
    info(strfmt("Time: %1",time2str(tmpTime,1,2)));
}

info(dayName(dayOfWk(str2Date('01-04-2014',123))));

No comments:

Post a Comment