This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Date issues!  RSS feed

 
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 657
Clojure Spring VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!