views:

39

answers:

1

I am using Google App Engine with Java, JDO for persistence. I have my Activity object with timestamp declared as Persistent and of type java.util.Date.

public class Activity ...
{ ...
  @Persistent
  private Date timestamp;
...
}

All Activities stored in the database are seen with correct dTate but time information is always zero. e.g Thu Sep 09 00:00:00.

In some other SO post (not related to google-app-engine though), I read we should use java.sql.Timestamp instead of Date in some cases, but GAE only supports java.util.Date.

One solution is always there to use 'long' to store the time information, but is there any better/preferred way to do this ?

A: 

So far I could not get any solution. I replaced the 'Date' with 'long' (indicating time in milliseconds) as mentioned in the question.

Gopi