wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes BigDecimal to Date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "BigDecimal to Date" Watch "BigDecimal to Date" New topic
Author

BigDecimal to Date

Tanu Gulati
Ranch Hand

Joined: Oct 06, 2008
Posts: 113

Can any body tell me how to convert BigDecimal to Date?


thanks
Tanu Gulati
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14150
    
  18

A BigDecimal holds a number. A Date is something completely different. Does your BigDecimal hold a number that somehow encodes a date? You need to know what the number in the BigDecimal means exactly to be able to convert it.

Assuming that your BigDecimal holds the number of milliseconds since 1 January 1970, 12:00 AM UTC (which is a common way to encode dates), you could do it like this:


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: BigDecimal to Date