Today I simply have a quick tip. I needed to be able to obtain the current date & time; something similar to the DateTime.Now() function in .NET or the getdate() function in SQL Server; However as far as I can tell, AX provides no quick function for this, so I wrote my own:
public utcdatetime Now()
{
str tDate;
str tTime;
utcdatetime utc3;
;
tDate = date2str(systemDateGet(), 321, DateDay::Digits2, DateSeparator::Hyphen, DateMonth::Digits2, DateSeparator::Hyphen, DateYear::Digits4);
tTime = time2Str(TimeNow(), TimeSeparator::Colon, TimeFormat::AMPM);
return str2datetime(tDate + " " + tTime, 321);
}
how about this method :-)
ReplyDeleteDateTimeUtil::utcNow();
TransDate TransDate=today();
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHi Sir,
ReplyDeleteI am asking for your help. Do you have any idea how to insert new row in MS Excel using x++ code? :-) God Bless!
Regards,
AML