Sign in to follow this  
Followers 0
tsichevski

Exporting dates to XML: milliseconds are not stored

5 posts in this topic

Hi all,

if you export a Perst database to an XML file, and then import it back, the millisecond parts in all java.util.Date objects imported are always zero :-(

Regards,

Vladimir

Share this post


Link to post
Share on other sites

It is intended behavior. Date values are exported to XML in the following format: "EEE, d MMM yyyy kk:mm:ss z"

So only seconds are saved.

Share this post


Link to post
Share on other sites

Hi perstmco,

It is intended behavior. Date values are exported to XML in the following format: "EEE, d MMM yyyy kk:mm:ss z"

So only seconds are saved.

Is there any workaround?

Regards,

Vladimir

Share this post


Link to post
Share on other sites

We have just uploaded a new version of Perst for Java to our website.

This version allows specifying the format for exporting/importing date values in XML using the "perst.xml.date.format" property.

The default value is "EEE, d MMM yyyy kk:mm:ss z".

You can use any format recognized by java.text.SimpleDateFormat and set this property something like this:

db.setProperty("perst.xml.date.format", "EEE, d MMM yyyy kk:mm:ss.SSS")

Share this post


Link to post
Share on other sites

Thanks, perstmco.

In the new 437 release this problem is fixed.

Regards,

Vladimir

We have just uploaded a new version of Perst for Java to our website.

This version allows specifying the format for exporting/importing date values in XML using the "perst.xml.date.format" property.

...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0