Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training
Reply
Contributor
mboldrick
Posts: 10
Registered: 12-13-2009
0

Are time fields (e.g., TimeCreated) stored as UTC?

An example of the value for TimeCreated (or TimeUpdated) is 17.97087. Does that correspond to 17:58 UTC? If not, how do I convert it to local (or UTC) time?

 

Thank you,

 

Mike

Super Contributor
Heather
Posts: 798
Registered: 10-29-2008
0

Re: Are time fields (e.g., TimeCreated) stored as UTC?

Welcome to the forums!

 

The value is a string field representing the time on your computer, which I suspect is local time.  So 17.97087 is 17:58 local time. 

 

There might be a better way to do this, but the formula I used to convert this field to something recognizable is:

 

  

If (Truncate(((ToNumber({TIMEFIELD})-Truncate(ToNumber({TIMEFIELD}))))*60))<10 then ToText(Truncate(ToNumber({TIMEFIELD})),0)+":0"+ToText(Truncate(((ToNumber({TIMEFIELD})-Truncate(ToNumber({TIMEFIELD}))))*60),0) Else ToText(Truncate(ToNumber({TIMEFIELD})),0)+":"+ToText(Truncate(((ToNumber({TIMEFIELD})-Truncate(ToNumber({TIMEFIELD}))))*60),0)

 

 

I didn't bother converting to a 12-hour clock from 24, but you could if you wanted.

Contributor
mboldrick
Posts: 10
Registered: 12-13-2009
0

Re: Are time fields (e.g., TimeCreated) stored as UTC?

Thank you!
Regular Contributor
russnobbs
Posts: 256
Registered: 11-01-2008

Re: Are time fields (e.g., TimeCreated) stored as UTC?

 There are other ways...

this formula converts a time stamp from mas90 to clock time

time(tonumber({SO_SalesOrderHeader.TimeCreated})/24)

FORMULA = CTime ({AR_CreditCardSettlementWrk.Time})

 

Russ Nobbs
Founder, Rings & Things, Spokane, WA USA
Super Contributor
Heather
Posts: 798
Registered: 10-29-2008
0

Re: Are time fields (e.g., TimeCreated) stored as UTC?

Thanks Russ.  I was hoping someone would post a better way to do that.
Super Contributor
DFeller
Posts: 2,944
Registered: 10-28-2008
0

Re: Are time fields (e.g., TimeCreated) stored as UTC?

Unfortunately these time stamps from MAS 90 are each computer's local time.  So a user in eastern time saves an order the same time as someone in pacific time and the time stamps are 3 hours apart.

 

For MAS 200 it is the server's time. 

 

Dawn

Sage MAS Partner
evigil
Posts: 8
Registered: 11-30-2009
0

Re: Are time fields (e.g., TimeCreated) stored as UTC?

Can this formula, time(tonumber({SO_SalesOrderHeader.TimeCreated})/24)

be converted to SQL or do you a SQL equivalent?