Results 1 to 5 of 5
Thread: using dates in java
- 02-09-2011, 03:28 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 11
- Rep Power
- 0
using dates in java
hi there,
i require to ask the user to enter the date in the format dd/mm/yyyy.
then the program should add 3 days with date provided by the user, and the result is output in the screen. I researched a bit, and i discovered something about a DATE CLASS .. however i tried to avoid using it.. and went to finding another alternative.. i tried to use simple data types...and used intgers as dd , mm and yyyy... however when having day 31 it does not make sense to add 3 to 31 having day 34 lool ... anyway... i need some help to sort this problem out... one thing is.. that i'm using this in a method.. so please guide me on what to insert the method header... not a problem to use the date class... i tried to avoid it just because i thought it was complicated... please keep things simple i;m a very beginner thanks so much!!! appreciate any help!
- 02-09-2011, 04:00 PM #2
Try class 'GregorianCalendar'.
- 02-10-2011, 12:08 AM #3
Member
- Join Date
- Feb 2011
- Posts
- 11
- Rep Power
- 0
thnks
i will try so tomorrow with the gregoriancalendar class...thanks so much for your reply! goodnight!
- 02-10-2011, 12:16 AM #4
You should also look at the SimpleDateFormat class which allows you to convert from a Date to a String and back again.
- 02-10-2011, 07:35 AM #5
Member
- Join Date
- May 2010
- Posts
- 90
- Rep Power
- 0
Similar Threads
-
Dates sometimes off by a day?
By saggio in forum Advanced JavaReplies: 13Last Post: 12-08-2010, 04:56 PM -
UTC Dates
By PedroCosta in forum Advanced JavaReplies: 3Last Post: 04-01-2010, 06:08 PM -
Help with dates
By bumblyb33 in forum New To JavaReplies: 1Last Post: 02-13-2009, 02:54 PM -
How to Compare two Dates
By Java Tip in forum java.utilReplies: 1Last Post: 06-24-2008, 07:05 AM -
differences between 2 dates
By cecily in forum New To JavaReplies: 1Last Post: 08-02-2007, 05:37 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks