You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by LOPEZ-CORTES Mariano-ext <ma...@pole-emploi.fr> on 2018/05/22 15:26:47 UTC

Solr Dates TimeZone

Hi

It's possible to configure Solr with a timezone other than GMT?
It's possible to configure Solr Admin to view dates with a timezone other than GMT?
What is the best way to store a birth date in Solr? We use TrieDate type.

Thanks!

Re: Solr Dates TimeZone

Posted by Erick Erickson <er...@gmail.com>.
And you do _not_ want to store anything except UTC for dates.
IMO, all the expectations about timezones are a remnant of when
computers were on-prem. You'll spend _endless_ hours trying
to deal with "the time shown is an hour off" if you try to store
anything except UTC on any server anywhere and deliver it
anywhere else.
</rant> ;)

Best,
Erick

On Wed, May 23, 2018 at 11:12 AM, Shawn Heisey <ap...@elyograg.org> wrote:
> On 5/22/2018 9:26 AM, LOPEZ-CORTES Mariano-ext wrote:
>> It's possible to configure Solr with a timezone other than GMT?
>
> No, at least not in the way that you're thinking.
>
>> It's possible to configure Solr Admin to view dates with a timezone other than GMT?
>
> As far as I know, this is not possible.  The information in search
> results is not interpreted at all, it is shown exactly as it is received
> from the server.  The server is going to send UTC, and it is going to
> expect UTC at index time if the input is a string.  It is up to client
> software to translate to the users timezone.
>
> It is possible to tell Solr what timezone it should use to determine day
> boundaries for date math -- NOW/DAY, NOW/WEEK, etc.  But the actual data
> will still be in UTC.
>
> Thanks,
> Shawn
>

Re: Solr Dates TimeZone

Posted by Shawn Heisey <ap...@elyograg.org>.
On 5/22/2018 9:26 AM, LOPEZ-CORTES Mariano-ext wrote:
> It's possible to configure Solr with a timezone other than GMT?

No, at least not in the way that you're thinking.

> It's possible to configure Solr Admin to view dates with a timezone other than GMT?

As far as I know, this is not possible.  The information in search
results is not interpreted at all, it is shown exactly as it is received
from the server.  The server is going to send UTC, and it is going to
expect UTC at index time if the input is a string.  It is up to client
software to translate to the users timezone.

It is possible to tell Solr what timezone it should use to determine day
boundaries for date math -- NOW/DAY, NOW/WEEK, etc.  But the actual data
will still be in UTC.

Thanks,
Shawn