System date in batch

Hi,

Currently i have met with one problem for displaying date time in batch program. what is the correct way to get current system date and time? Because there is lot of functions are there to display the date and time. And My batch Program is displaying previous date not today date…It affects all the records… The below code i have used

_SCOBIntfTxnStatus.IntfDateIns= DateTimeUtil::date(DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::getSystemDateTime(),

DateTimeUtil::getUserPreferredTimeZone()));

now i got panic … Is there any idea to solve…Plz help me…

Thanks in advance…

Hi Parthiban,

welcome to the Dynamics User Group. Please always use a descriptive title - I’ve changed it to “System date in batch” because it’s more informative than “Hi to all,”. Please also always attach a tag with your version of AX - there are quite significant differences between various versions.

Thank you.

Ah, and I see that it’s also a duplicate. I’m locking this thread, let’s continue at http://dynamicsuser.net/forums/t/72755.aspx.