Manjit wrote:This is the strategy employed by Java's java.util.Date, java.sql.Date and java.ql.Timestamp ; they all store the number of milliseconds since 1/1/1970 00:00:00:000 UTC. If you use any of these with PreparedStatments then you will have nothing to do. Do not even think about storing the data as a varchar since this would mean you would have to do all the hard work yourself.
For this requirment I am planning to do the following.Service request with date will be converted to GMT before it is stored in database and the response back will be converted from GMT back to the time zone of the requester and have the application server/database server configured to UTC time.Is this a good strategy or is there a better one.
Manjit wrote:The Oracle Date field can be set using a PreparedStatement and using java.sql.TimeStamp objects. Effectively java.sql.TimeStamp objects already store the date as UTC which can be regarded as GMT. No conversion required. Don't make work for yourself.
But still not sure about the other riddle.Remember in my oracle databse we have the date field as Date and not Timestamp.I still feel we should convert to/fro dates to GMT.
Manjit wrote:The above statement is indefinite.
Sabre,to confirm again...you are suggesting that there is even no need to change the oracle Date field from Date type to Timestamp.The only thing I really have to do is for display purpose convert/format the response date to the zone the request is coming from.Please let me know if I missed anything.