lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Solr date retrieve back UTC
Date Thu, 19 Feb 2015 21:27:25 GMT

: to get the UTC back which I thought might not be required as already the
: cDate field in that Date class is having the UTC date.

general suggestion: your life will be a lot easier if you stop looking at 
the implementation details of JVM classes -- just because your current JVM 
implements the Date class with some internal "cDate" field doesn't mean 
that the next JVM release (or some JVM sold by another company) will be 
implemented the same way.

: The toString() doesn't actually give me timestamp in UTC format. It gives,

the representation returned by toString() is entirely dependent on your 
locale.  please read my comment fully.  there are *LOTS* of tutorials on 
the internet about dealing with Date & DateFormat objects in java...

>> Date objects in Java do not have any intrinsic TimeZone -- they 
>> represent absolute fixed moments in time.  to "see" a Date in UTC (or 
>> any other time zone) you must convert it to a String -- either by using 
>> hte detault "toString()" representation, or by using a DateFormat.


View raw message