on 09-25-2006 9:12 AM
hello everybody,
I have got two dates as strings! format yyyymmdd!
I want wo know the number of days between the days.
I guess, first I have to convert the strings to date types?
How can I do this?
Regards Mario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Try this
GregorianCalendar da1 = new GregorianCalendar(2004,0,1,1,1,1);
GregorianCalendar da2 = new GregorianCalendar(2004,1,9,8,5,10);
long d1 = da1.getTime().getTime();
long d2 = da2.getTime().getTime();
long difMil = d2-d1;
long milPerDay = 10006060*24;
long milPerOra = 10006060;
long milPerMin = 1000*60;
long milPerSec = 1000;
long days = difMil / milPerDay;
See this link
http://www.faqs.org/qa/qa-10170.html
Kind Regards
Mukesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.