Microsoft Dynamics Support Forum Index Microsoft Dynamics Support
Visit the Microsoft Dynamics newsgroups and exchange ideas with a community of business professionals and product experts from around the globe.
 
   ProfileProfile   Log in to check your private messagesLog in to check your private messages  |  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups Log inLog in   RegisterRegister 

Universal Time Issues

 
Post new topic   Reply to topic    Microsoft Dynamics Support Forum Index -> Microsoft Dynamics AX Localization
Author Message
IMRTD
Guest





PostPosted: Thu Sep 06, 2007 12:44 pm    Post subject: Universal Time Issues Reply with quote

Hi All,

I am a bit curious about how AX4.0 supports GMT time zones. Lets say i
create an EDT of Date type and use it on a form. The data in this EDT will be
stored with time component as well into the database and this time will not
be GMT. Is there anyway in Axapta to store date and time data that recognizes
GMT time zone?

Regards
Back to top
Nitin Goyal
Guest





PostPosted: Fri Sep 14, 2007 10:58 pm    Post subject: RE: Universal Time Issues Reply with quote

I think this feature is not available in Ax 4.0. Thanks, Nitin

"IMRTD" wrote:

Quote:
Hi All,

I am a bit curious about how AX4.0 supports GMT time zones. Lets say i
create an EDT of Date type and use it on a form. The data in this EDT will be
stored with time component as well into the database and this time will not
be GMT. Is there anyway in Axapta to store date and time data that recognizes
GMT time zone?

Regards
Back to top


Guest






PostPosted: Mon Sep 17, 2007 8:32 pm    Post subject: Re: Universal Time Issues Reply with quote

On Sep 14, 1:58 pm, Nitin Goyal <NitinGo...@discussions.microsoft.com>
wrote:
Quote:
I think this feature is not available in Ax 4.0. Thanks, Nitin



"IMRTD" wrote:
Hi All,

I am a bit curious about how AX4.0 supports GMT time zones. Lets say i
create an EDT of Date type and use it on a form. The data in this EDT will be
stored with time component as well into the database and this time will not
be GMT. Is there anyway in Axapta to store date and time data that recognizes
GMT time zone?

Regards- Hide quoted text -

- Show quoted text -

It seems to me AX *should* be recording the date and time from the
server's point of view (or GMT/UTC), and converting to and from the
end user's local time zone on the fly. I take it this is not the case.
Back to top


bpskiles
Guest





PostPosted: Mon Mar 03, 2008 3:06 pm    Post subject: RE: Universal Time Issues Reply with quote

I had this problem as well. There is a way to display a time in the user's
local time zone, but it's ugly. It works very well, though. My users are
happy with it. Let me know if you make any improvements, as I'd like to see
any. Also, let me know if you have any questions.

I created a table called 'TimeZoneCalculator'
I changed properties CreatedDate and CreatedTime to Yes.
It has two fields: CurrentTime (time) and SessionId (int)

There are 3 static methods on the table (code below):
GetLocalTimeFromServerTime
GetLocalTimeOffset
GetServerTimeFromLocalTime

static TimeOfDay GetLocalTimeFromServerTime(TimeOfDay serverTime)
{
return serverTime - TimeZoneCalculator::GetLocalTimeOffset();
}

static TimeOfDay GetServerTimeFromLocalTime(TimeOfDay localTime)
{
return localTime + TimeZoneCalculator::GetLocalTimeOffset();
}

static int GetLocalTimeOffset()
{
timeOfDay t;
TimeZoneCalculator tzc;
Session s;
int offset;
str cacheName;
;
// store stuff in the globalcache to speed lookups
s = new xSession();
// sessionid is added to the cache name so that a user
// can have multiple sessions in different time zones.
cacheName = "time_offset_" + int2str(s.sessionId());
if (infolog.globalCache().isSet(curuserid(), cacheName)) {
// don't bother calculating it again
return any2int(infolog.globalCache().get(curuserid(), cacheName));
} else {
ttsbegin;
// delete anything that already exists
delete_from tzc where tzc.SessionId == s.sessionId();
tzc.SessionId = s.sessionId();
// set current time to the client's local time
tzc.CurrentTime = timenow();
tzc.insert();
tzc.write();
// created time will get populated here
ttscommit;
select tzc where tzc.SessionId == s.sessionId();
// calculate the offset
offset = tzc.createdTime - tzc.CurrentTime;
// add it to the global cache for good luck!
infolog.globalCache().set(curuserid(), cacheName, offset);
return offset;
}
}



"IMRTD" wrote:

Quote:
Hi All,

I am a bit curious about how AX4.0 supports GMT time zones. Lets say i
create an EDT of Date type and use it on a form. The data in this EDT will be
stored with time component as well into the database and this time will not
be GMT. Is there anyway in Axapta to store date and time data that recognizes
GMT time zone?

Regards
Back to top


Display posts from previous:   
Post new topic   Reply to topic    Microsoft Dynamics Support Forum Index -> Microsoft Dynamics AX Localization All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Powered by phpBB © 2001, 2005 phpBB Group

eXTReMe Tracker