Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #27764

Re: how to compare date and get latest one

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: how to compare date and get latest one
Date Fri, 14 Mar 2014 21:20:21 +0000 (UTC)
Organization A noiseless patient Spider
Lines 29
Message-ID <lfvrql$s2o$1@dont-email.me> (permalink)
References <374d2575-df01-45de-8267-4c9b579e56be@googlegroups.com> <p695i99v87dkgvp8nbafplokjrsiv5afve@4ax.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Date Fri, 14 Mar 2014 21:20:21 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="28760"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tF28XTXzuaTWz9WfHivi1v6Ih0PsKAdQ="
User-Agent Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2)
Cancel-Lock sha1:Mzj0jmb08G/X3QeKS9308WJyt2g=
Xref csiph.com comp.lang.java.programmer:27764

Show key headers only | View raw


On Thu, 13 Mar 2014 23:42:54 -0700, Roedy Green wrote:

> On Thu, 13 Mar 2014 08:16:32 -0700 (PDT), Navneet Mathpal
> <navneetmathpal93@gmail.com> wrote, quoted or indirectly quoted someone
> who said :
> 
>>For insertion of time i am using Date date=new Date();
> 
> don't Dates implement Comparable?
> 
> I don't know about Spring.

Give or take a method or two java.util.Date and java.sql.Date are 
effectively the same; java.sql.Date is an extension of java.sql.date as 
is clearly stated in the standard class library documentation.

IOW, both hold dates as milliseconds since January 1, 1970 00:00:00.000 
GMT, which is both the UNIX base date and the SQL Standard base date. IOW 
you can do simple comparisons by using the methods defined in 
java.util.Date, but for anything more complex than that I use the methods 
in java.date.GregorianCalendar and I use java.textSimpleDateFormat for 
formatting and parsing date strings, i.e. all conversions between Date 
and String objects.
 

-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

how to compare date and get latest one Navneet Mathpal <navneetmathpal93@gmail.com> - 2014-03-13 08:16 -0700
  Re: how to compare date and get latest one Roedy Green <see_website@mindprod.com.invalid> - 2014-03-13 23:42 -0700
    Re: how to compare date and get latest one Martin Gregorie <martin@address-in-sig.invalid> - 2014-03-14 21:20 +0000
      Re: how to compare date and get latest one Martin Gregorie <martin@address-in-sig.invalid> - 2014-03-14 22:11 +0000

csiph-web