Показать сообщение отдельно
Старый 10.08.2010, 02:07   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Dynamics AX Sustained Engineering: Date\time data reflected in User's preferred time zone after conversion from UTC
Источник: http://blogs.technet.com/b/dynamicsa...-from-utc.aspx
==============

Scenario

When running reports that contain date\time information that is stored in the database in UTC format the reports are showing the user's preferred time zone instead of the company's specified time zone.

Resolution

To display the timezone information in the company timezone instead of the user's perferred time zone, you can change the setText method (Example from \Reports\HRMCourseAttendeeStatusList):

From:

void setText()
{
periode.text(strfmt("@SYS53184", date2StrUsr(DateTimeUtil::date(hrmCourseTable.StartDateTime), DateFlags::FormatAll),
date2StrUsr(DateTimeUtil::date(hrmCourseTable.EndDateTime), DateFlags::FormatAll)));

}

To:
...
periode.text(strfmt("@SYS53184", date2StrUsr(DateTimeUtil::date (DateTimeUtil::applyTimeZoneOffset(hrmCourseTable.StartDateTime, DateTimeUtil::getUserPreferredTimeZone())), DateFlags::FormatAll),
date2StrUsr(DateTimeUtil::date (DateTimeUtil::applyTimeZoneOffset(hrmCourseTable.endDateTime, DateTimeUtil::getUserPreferredTimeZone())), DateFlags::FormatAll)));
...
}




Источник: http://blogs.technet.com/b/dynamicsa...-from-utc.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.