Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

object to date conversion  RSS feed

 
kizgincocuk kizgincocuk
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..

is there a way to cast object to date class...
my problem is I save(write a file) some date ,and read it then can not convert to date again..
thanx a lot..
:roll:
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you writing/reading it?
You might want to take a look at java.text.SimpleDateFormat for easy conversion between Dates and Strings. That way, you can have the Date in memory, write it out to the file as a String, read it from the file as a String, and then convert it back to a Date in Memory.
 
kizgincocuk kizgincocuk
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for quick reply ...
that's what i looking for
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!