• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

BigDecimal to Date

 
Tanu Gulati
Ranch Hand
Posts: 113
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any body tell me how to convert BigDecimal to Date?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15441
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic