• Post Reply Bookmark Topic Watch Topic
  • New Topic

Get Date from a long  RSS feed

 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help me to get the Date from a long value

Thanks in advance
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not until you tell us what encoding you are using.
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
initially i use

Calendar calendar =Calendar.getInstance();
then I get the long value like this.
long d=calendar.getTime().getTime()

I do some calculations with this long value,at last i need to convert to the date.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the API for Date. Do any methods or constructors involve longs?

Also, do you really need to manipulate the long value directly? Calendar has methods that let you rollback a time to midnight, etc... What specifically are you computing?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!