Announcements
No record found.
Hi,
I have the following:
str dateString = "Sunday, 21 Feb 2010 19:05:15 GMT"
how can i convert this to UTCDateTime?
Please refer this thread: https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/125802/converting-string-into-datetime
HI Junior,
You can convert RFC1123 string time format to DateTime,and then convert it to UTCDateTime.
DateTime zdt = DateTime::Parse("Thu, 25 Aug 2016 08:59:00 GMT" ); udateTime = Global::CLRSystemDateTime2UtcDateTime(zdt);
Hi
Dynamics AX 2012 utilizes the utcDateTime data type to store date time information in the database using the Greenwich Mean Time definition of time. This allows the data to be date stamped in a manner that does not reflect the client or AOS time zone (this date/time stamp is considered to be time zone agnostic).
DateTimeUntil class: https://docs.microsoft.com/en-us/previous-versions/dynamics/ax-2012/system-classes/gg837448(v=ax.60)?redirectedfrom=MSDN
static void DateConvert(Args _args){ UTCDateTime myDateTime,gmtDateTime; str strDate; //The sequence 123 describes the position of day (1), month (2), year (3). int intSeq; Timezone myTimeZone = Timezone::GMTPLUS0800BEIJING_CHONGQING_HONGKONG; ; // Sunday, 21 Feb 2010 19:05:15 GMT strDate = "21 Feb 2010 19:05:15"; intSeq = 123; myDateTime = str2datetime(strDate,intSeq); info(strFmt("datetime in GMT: %1",datetime2str(myDateTime))); myDateTime = DateTimeUtil::applyTimeZoneOffset(myDateTime,myTimeZone); info(strFmt("datetime in GMT+8: %1",datetime2str(myDateTime))); //myDateTime = str2datetime(strDate,intSeq); gmtDateTime = DateTimeUtil::removeTimeZoneOffset(myDateTime,myTimeZone); info(strFmt("datetime in GMT: %1",datetime2str(gmtDateTime)));}
Hi junior AX,
Please refere to this 2 links, you will find your answer:
String format options for UtcDateTime:
dev.goshoom.net/.../
Working with utcDateTime Functionality in Dynamics AX 2012 :
stoneridgesoftware.com/.../
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 659
André Arnaud de Cal... 465 Super User 2026 Season 1
Syed Haris Shah 304 Super User 2026 Season 1