• Post Reply Bookmark Topic Watch Topic
  • New Topic

SimpleDateFormat (calculation)  RSS feed

 
Donatas Latauskas
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am trying to write a simple program which calculates how many days people have been lived in a house. I have data file named "People.txt" which has such structure:
LastName FirstName CameIn CameOut DayCost

I have written a program which makes the "Summary.txt" file like this:
LastName FirstName CameIn CameOut DayCost
But I need to get the structure of this:
LastName FirstName CameIn DaysLived NeedsToPay

But I don't know how to make a calculation of DaysLived from the CameIn and CameOut dates.

Example of People.txt:
HaradaTsujoshi2006.04.122006.05.1225.0
Example of Summary.txt
Harada TsujoshiWed Apr 12 00:00:00 EEST 2006Fri May 12 00:00:00 EEST 200625.0

The code:

Methods.java

[ September 18, 2006: Message edited by: Donatas Latauskas ]
 
Donatas Latauskas
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have solved this, with this code:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!