public static void UTCDateTimeConversion()
{
UTCDateTime dateTime;
date tmpDate;
TimeOfDay tmpTime;
CustTable cTable = CustTable::find("1101");
;
// Extracted date & Time from UTCDateTime datatype to individulal variable
dateTime = cTable.createdDateTime;
tmpDate = DateTimeUtil::date(dateTime);
tmpTime = DateTimeUtil::time(DateTimeUtil::applyTimeZoneOffset(dateTime, DateTimeUtil::getUserPreferredTimeZone()));
info(strfmt("Date: %1 and Time: %2.", tmpDate, time2str(tmpTime,1,2)));
// assign UTCDateTime varriable by using two individual field
dateTime = DateTimeUtil::newDateTime(12\05\2010, timeNow());
info(strfmt("UTCDateTime: %1.",dateTime));
}
{
UTCDateTime dateTime;
date tmpDate;
TimeOfDay tmpTime;
CustTable cTable = CustTable::find("1101");
;
// Extracted date & Time from UTCDateTime datatype to individulal variable
dateTime = cTable.createdDateTime;
tmpDate = DateTimeUtil::date(dateTime);
tmpTime = DateTimeUtil::time(DateTimeUtil::applyTimeZoneOffset(dateTime, DateTimeUtil::getUserPreferredTimeZone()));
info(strfmt("Date: %1 and Time: %2.", tmpDate, time2str(tmpTime,1,2)));
// assign UTCDateTime varriable by using two individual field
dateTime = DateTimeUtil::newDateTime(12\05\2010, timeNow());
info(strfmt("UTCDateTime: %1.",dateTime));
}