• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Improvements in Dates.

 
Ranch Hand
Posts: 125
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I write code using java 1.4 and know the concepts of 5. Will it take more time to upgrade till 7? Only opportunity to work on 7 comes when the application servers ship it.

Its always not easy to deal with Dates, first fetching date from the database and converting it into GregorianCalendar, using some customized wrappers to get them in desired format. Are there any improvements in dealing with Dates.

Thanks,
Kumar.
 
author
Posts: 84
5
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There have been quite a few changes to Java since 1.4. It is hard to predict how much time it would take to upgrade to Java 7. It depends on several factors including the application type and its needs to use any relevant new features. With regards to date/time, Java 7 has a FileTime class used to represent a time stamp for a file. In addition, there is support for handling the number of weeks an the current week of a year in Java 7. Both of these topics are covered in the book. You are correct when you say working with dates is not easy. Time is a complex topic. Java has provided only incremental date/time improvements with each new version.
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

kumar naresh wrote:Hi,

I write code using java 1.4 and know the concepts of 5. Will it take more time to upgrade till 7? Only opportunity to work on 7 comes when the application servers ship it.



Upgrading your application to 7 from 1.4 will take considerable amount of time as it depends on your application landscape and what effect it might have on the other interfacing systems. But on the other hand, upgrading your knowledge from Java 1.4 to Java 7 should be a breeze considering the fact that you are an experienced developer. But again this depends on the individual.

From my point of view wherein I recently started venturing in C#, it was not at all difficult to learn the new features like delegates, lambda expressions and of course the C# syntax. I'm enjoying it. I now only have to get used to writing and executing C# code.
 
naresh kumar nand
Ranch Hand
Posts: 125
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the responses.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately Java 7 does not yet have an improved date and time API.

There is JSR 310, which is a project to add a new date and time API that will probably look a lot like Joda Time. Joda Time is a popular date and time library for Java with a much better designed API than Java's Date and Calendar classes.

See the ThreeTen Project, which is where the new API is being developed.

I hope this is going to be added to Java 8. In the meantime, I highly recommend using the Joda Time library when you have to work with dates and times.
 
naresh kumar nand
Ranch Hand
Posts: 125
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Jesper for the response and Joda seems to be interesting.

But if we take a real time scenario, where if quantities are stored in the daily duration in database and if it has to be represented in terms of Week, Month and Year. A lot of date manipulations get involved to show them in the desired UI format.

In fact it is a case to case scenario but I tried to give an example where Date manipulations are involved.
 
reply
    Bookmark Topic Watch Topic
  • New Topic