11-07-2009 02:15 AM
Hello,
In my App. i need to display next 14 days Dates from current day.
How can i get next 14 dates?
i am able to get current date.
Thanks in advance.
Solved! Go to Solution.
11-07-2009 02:26 AM
You can convert the current date time to milliseconds and vice versa. Add how many milliseconds there are in a day and convert back to a date, fourteen times.
11-07-2009 02:30 AM
Bingo !!
i just now tried the same thing and its working fine.
1 day = 86400000 millis
long currentTime = System.currentTimeMillis(); currentTime += 86400000; // for 14 times
11-08-2009 08:48 PM
Be aware that this approach may not work around DST change time, because days can be shorter or longer than 24 hours.
I prefer to use the DateTimeUtilities.ONE_DAY type constants when incrementing/decrementing the time.
11-08-2009 10:16 PM
Ohh
I should take care of it. I will work around and will be back if any queries or solutions.
Thanks peter_strange