AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 29.06.2009, 19:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
axaptapedia: Trap systemdate
Источник: http://www.axaptapedia.com/Trap_systemdate
==============

Summary: becareful with using DateTimeUtil::getSystemDateTime

== SystemDate/SystemDateTime ==
The methods systemDateSet( Date _date) and systemDateGet() are known from earlier versions and will work in Version 2009 fine.

The problems are the methods getSystemDateTime and setSystemDateTime.
getSystemDateTime will return the current session datetime in UTC-timeformat until the sessiondate changes. The sessiondate can be changed by calling the methods systemDateSet or DateTimeUtil::setSystemDateTime. After changing the sessiondate the time will be stand still. It works like in earlier versions, you're setting a new sessiondate, so your AX session will work with that new sessiondate until the client closes. Now (in DAX2009), you're setting a session datetime, so your AX session will work with that new session datetime until the client closes.

try the following code in a job and run it multiple times.
Job1: running this job in a newly started client will show you a running time.

print systemDateGet();
print DateTimeUtil::getSystemDateTime();
print DateTimeUtil::utcNow();


Job2: run this job for changing the sessiondate or change it with [Extras / Sessiondate]

systemDateSet( today() );
print DateTimeUtil::getSystemDateTime();
print DateTimeUtil::utcNow();

The Job2 will show you a running utcNow, but the getSystemDateTime will show you a time stopped. You'll get the same result using the setSystemDateTime.

Btw., setting the sessiondate with systemDateSet results to a systemDateTime as UTC -9.
But why? The Windows-System, the DAX-Company and the user are using UTC +1.


[[category:caution trap]]


Источник: http://www.axaptapedia.com/Trap_systemdate
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axaptapedia: Trap typecast Blog bot DAX Blogs 6 23.06.2009 16:10
axcoder: PowerShell + Ax Blog bot DAX Blogs 1 09.01.2009 18:05
axaptapedia: Load Web Documents Blog bot DAX Blogs 1 03.01.2009 23:50

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 23:23.