Epoch Date

A discussion forum for the JCommon class library.
Post Reply

Epoch Date

Post by Michael » Thu Nov 15, 2001 2:44 am

Is there any way that I can obtain the Epoch date in seconds for the date required using the JCommon ?? If there is mind letting me know because I tried many ways and I can only get a 13 digits long value and what I wanted is a 10 digit long value. Please advice.

David Gilbert

RE: Epoch Date

Post by David Gilbert » Thu Nov 15, 2001 10:43 am

Hi Michael,

The SerialDate and SpreadsheetDate classes are designed to work with whole days only. I needed a date class that works in a similar way to dates in Excel, so that's why I wrote it.

The earlier versions of JCommon used BigDate from Canadian Mind Products (US$10 registration fee) - it's a great piece of code, but it's inconvenient to require users of JCommon to register BigDate so I'm not including it with JCommon any more.
SerialDate is supposed to implement a toDate() method to convert to java.util.Date - I haven't thought much about how to handle time zones and the fact that java.util.Date has lots more precision than SerialDate so you probably shouldn't rely on the conversion just yet.



Post Reply