Can I set the Object::creationTime value?

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Can I set the Object::creationTime value?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:25 pm

by John Beaufoy >> Mon, 2 Feb 2009 10:42:40 GMT

We are writing a generic tool to allow extraction of partial/all data from one jade db and being able to load this into another jade system.

The creationTime value is set according to the OS time when an object is created and there doesn’t seem to be any obvious way of changing it. The problem comes if the application uses this value for (say) a message line stating "This record was created on xx/xx/xx”." as it no longer reflects the date from the original database.

A solution that allows this to be specified at the time of object creation, or where it can be set manually is what we’re after, any thoughts?

Cheers,
John Beaufoy
NWI

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Can I set the Object::creationTime value?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:25 pm

by BeeJay >> Mon, 2 Feb 2009 19:22:31 GMT

It was partly for this reason, but also because we needed to display the "correct" time regardless of the current daylight savings offset versus that which was in use at the time the object was created that we use our own timestamp property rather than Jade's object creation time.

eg: If it happened at 10:30 in the morning, we want it to always say 10:30 in the morning, not 09:30/10:30 or 10:30/11:30 depending on which side of DST adjustment it was created/displayed.

Hope that helps.

Cheers,
BeeJay.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Can I set the Object::creationTime value?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:25 pm

by John Beaufoy >> Mon, 2 Feb 2009 19:47:44 GMT

Thanks BeeJay.

I agree it’s use should be avoided in production code.

Ideally we can provide a solution that works without having to amend any existing application code. As Object::creationTime is in use already, for now this is not an option.

I was hoping there may be an external function call, possibly around jade's own extract/loader functionality (which I understand preserves the creation time) that may be able to be used.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Can I set the Object::creationTime value?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:25 pm

by Jade Support >> Mon, 2 Feb 2009 22:40:29 GMT

The creation time of an object is set by JADE when the object is created. It cannot be specified by the application or changed once set.

For your interest, the creation time of an object is stored in the object is UTC (Universal Time Coordinated).

Object::creationTime() returns a timestamp whose value is the UTC time adjusted (on Windows) using the value returned by the OS routine GetTimeZoneInformation.

This uses the time zone setting of either the OS process logon or the system settings. The documentation does not specify.
Thin client users will see an AppServer relative value rather than their own desktop.

The intent of the Object::creationTime method is to return the creation time converted to local time (it is stored in UTC time on the object). It is generally desirable that local time takes into account daylight savings and this is the intent.

It is essential to handling recovery through a daylight savings time change for UTC information to be used. i.e. what you're seeing is correct and you should continue to use your own audit information least the internally stored timestamp causes confusion.

Thank you,
Jade Support.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 13 guests