Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
    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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Calculate Date having DIFFERENT DATE FORMATS  RSS feed

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi ....
I want to calculate date difference between 2 DIFFERENT DATE FORMATS ... one of my date format is "yyyy/mm/dd" and the other date format is "yyyy/mm/dd hh:mm:ss" ............... how can i calcaulate the difference between these two dates and then display the result in a String in the format of yyyy/mm/dd ???.???
more over i want to make a comparision also ... like if(date1 > date 2) .. then i = 1 else i =0;
So i want help on 2 things .....
1. Finding difference
2. Comparing and then incrementing value of a temp variable.
plz some one help me out on this .........................
Thanx
 
Mehak Daani
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Report post to moderator
Ok .... I have converted the both the dates to the same format ... now how do i COMPARE them ...???
 
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Report post to moderator
Look at the methods in the java.util.Date class.
 
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
This is pretty much the same question you posted a little while ago (and which has been moved to the Java in General/Intermediate forum). Please do not post the same question multiple times in either the same, or across multiple, forums.
thanks,
bear
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!