*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 14074
    
  16

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
 
Don't get me started about those stupid light bulbs.
 
subject: BigDecimal to Date
 
Similar Threads
Date comparision in java
BigDecimal to Date Conversion
data type for large decimals
a question about the ActionForm 's property type
Loosing Object-Oriented Design points - URLyBird