If the desired output format is the same for every query, I would store the formatted date in a separate string field when indexing. You can query the date field, but return the string field instead.
Thomas Op do 17 mrt. 2022 om 22:08 schreef Shawn Heisey <elyog...@elyograg.org>: > On 3/17/22 14:46, Teresa McMains wrote: > > I would like to return the transaction date as a date without the time > > stamp or time zone but instead it looks like this: > > > > Do you know how I might have it strip the timestamp and time zone > > using a function in the query? Or do I have to change schema.xml (and > > to what)? > > I started the techproducts example, which has a field type of pdate, > using a Point type rather than the Trie type you are using, but I > believe that the Trie type behaves the same. > > We cannot see your image. The mailing list ate it. You'll need to give > us text, not an image. > > Here is what I get when I add a document to the example techproducts > index with a date value and then query for that document: > > |"response":{"numFound":1,"start":0,"numFoundExact":true,"docs":[ { > "id":"foo1", "test_dt":"2009-04-05T12:34:56Z", > "_version_":1727582227100860416}] There is no timezone. It's always in > UTC. Any transformation to a timezone or the removal of the timestamp > would need to be done in your application that queries Solr before > giving the result to the end user. You might also want to investigate > the DateRangeField class. It has concepts of values that represent an > entire time period, such as a whole day. Thanks, Shawn | > >