thanks Cris

    I've used this configuration to my timestamp field and it's works

<field name="timestamp" type="date" indexed="true" stored="true" default="NOW+1HOUR" multiValued="false"/>

Anyway, I would like to know possible configuration of TZ parameter. When you speak "clients can specify a "TZ" param", this means it is possible configure TZ parameter using solrconfig.xml or schema.xml files ??

Best regards.


El 05/03/2013 18:32, Chris Hostetter escribió:
: when I've checked the new data, I see datetime value have one hour less than
: current date.

Please note the documentation about DateField (and TrieDateField which
extends it)...

https://lucene.apache.org/solr/4_1_0/solr-core/org/apache/solr/schema/DateField.html

The response format is *always* in UTC so that it is consistent for all
clients, regardless of what locale the server is running in -- because the
clients may not *know* what locale the server is running in.

If you use SolrJ then you will get java.util.Date objects back and you
can format them in whatever local your client would like.

Note however that clients can specify a "TZ" param when making requests to
control the timezone used for the purposes of *rounding* -- eg: if you say
"NOW/DAY" the TZ specified will determine when the start of the day is,
but the resulting Date value will still be formated in UTC so it can
consistently be interpreted in all clients.

(Aparently the "TZ" param has never really been documented ... i'll try to
rectify that)


-Hoss



Reply via email to