| Author |
Date issues!
|
bob connolly
Ranch Hand
Joined: Mar 10, 2004
Posts: 204
|
|
Hello, I just found this resolution for a a Date issue that i'm having, Thanks very much!, but assume that Sun has resolved their lack of Date handling routines by now? If not, i'm totally shocked!, but again assume there must be a good reason? A SAS tool that i use has a myriad of Date handling routines and documentation! Thanks much for any insights on this!
|
 |
Steve Morrow
Ranch Hand
Joined: May 22, 2003
Posts: 657
|
|
I'm unable to determine if you have a question. What insights are you looking for? Calculating Java dates: Take the time to learn how to create and use dates Working in Java time: Learn the basics of calculating elapsed time in Java
|
 |
bob connolly
Ranch Hand
Joined: Mar 10, 2004
Posts: 204
|
|
Thanks Steve! I quess i'm really suprised that Sun has made the Date handling so confusing, ie what ever happened to the good ole "d.getMonth" ect! I've been trying to get this to work all morning to no avail, do you see anything obvious Steve? $ ksh t.ksh Note: t.java uses or overrides a deprecated API. Note: Recompile with -deprecation for details. 1. Wed Sep 21 04:24:54 EDT 2005 ERROR: Cannot parse "Wed Sep 21 04:24:54 EDT 2005" String ldt= new String("Wed Sep 21 04:24:54 EDT 2005"); Date dto= new Date(ldt); String dateString = dto.toString(); System.out.println(" 1. " + dateString); SimpleDateFormat format = new SimpleDateFormat("yyMMdd"); try { Date parsed = format.parse(dateString); System.out.println(" 2. " + parsed.toString()); } catch(ParseException pe) { System.out.println("ERROR: Cannot parse \"" + dateString + "\""); } Thanks for any inputs on this Steve!
|
 |
 |
|
|
subject: Date issues!
|
|
|