hi time differences in ax 2012

hi all

while inserting the record it is insert with correct date time

datetime =datetimeutill::systemdatetimeget(),timenow();

but while showing the form it is showing the previous date with diffrent time

wht might be the problem

if any body know please help me

thanks,

srikanth

AX stores datetime as UTC values and applies user’s time zone before showing it in forms etc. The problem is that you save local time as it was UTC datetime, which is wrong - AX will apply the time zone offset to the local time again.

You have to convert your time to UTC be removing the time zone offset - see DateTimeUtil::removeTimeZoneOffset(). Also, look at DateTimeUtil::utcNow(), it may be applicable in your case.