23.07.2009, 01:05 | #1 |
Участник
|
axaptapedia: UtcDateTime
Источник: http://www.axaptapedia.com/UtcDateTime
============== Summary: Since version 2009 Dynamics AX supports different timezones. This feature is implemented in way that a UtcDateTime value is converted to UTC time when stored in database. The conversion is transparent for the user. The value is converted back to local time when it is viewed on form or report. * Be aware that the table browser does this conversion too! The value in the table browser may NOT be the value in the database. * Conversion is not applied for X++ code, you have to do this by your own! ==Example== This example is create in Austria at Summertime, thats UTC + 2 [[Image:Utc_form.png]] [[Image:Utc_tablebrowser.png]] 22.7.2009:00:00 Austria is 21.7.2009:22:00 in UTC [[Image:Utc tablesql.png]] static void Job2(Args _args) { UtcDateTimeDemo demo; ; select firstonly demo where demo.RecId == 5637144576; // prompts the value from the table, no conversion here! info(strfmt("%1",demo.UtcField)); // thats the expected value! info(strfmt("%1", DateTimeUtil::applyTimeZoneOffset(demo.UtcField,DateTimeUtil::getClientMachineTimeZone()))); } When you fetch data from the database you have to apply the timezone to get the local value [[Image:Utc infolog.png]] ---- [[Category:General development]] Источник: http://www.axaptapedia.com/UtcDateTime
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
Похожие темы | ||||
Тема | Ответов | |||
DAX 2009 & UtcDateTime & Primary Key | 8 | |||
axaptapedia: Tutorial Password | 1 | |||
axcoder: PowerShell + Ax | 1 | |||
axaptapedia: Load Web Documents | 1 |
|