# Timezone Precedence in Date Filter

**URL:** <https://discuss.elastic.co/t/timezone-precedence-in-date-filter/196380>\
**Category:** Logstash\
**Created:** [August 22, 2019, 6:12pm UTC](https://discuss.elastic.co/t/timezone-precedence-in-date-filter/196380 "2019-08-22T18:12:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DougR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dougr/32/48095_2.png) [@DougR](https://discuss.elastic.co/u/DougR)\
**Post date:** [August 22, 2019, 6:12pm UTC](https://discuss.elastic.co/t/timezone-precedence-in-date-filter/196380/1 "2019-08-22T18:12:46Z")

</div>

# TL;DR

Which takes precedence in a date filter - the timezone in the timestamp or the timezone specified in the filter?

# Longer Version

A question regarding the date filter. I have the following date filter:

```
date {
    match => ["[@metadata][_timestamp]", "ISO8601"]
    timezone => "US/Central"
    target => "@timestamp"
    tag_on_failure => []
}

```

If I have the following date, it will process it as the US Central timezone:

```
2019-08-22T12:00:00,000

```

However, if I have the following date:

```
2019-08-22T17:00:00,000Z

```

which translates to the same time in US Central Daylight time, will it process it as UTC (as specified in the timestamp), or will it disregard the timezone specified in the timestamp and use the `timezone => "US/Central"`, causing it to store as an incorrect time? the following line in the [date filter documentation](https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html) seems to imply that the timezone option in the date filter is only used if it's not specified in the timestamp, but I want to confirm:

> [The timezone option] is useful in case the time zone cannot be extracted from the value, and is not the platform default.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 22, 2019, 6:40pm UTC](https://discuss.elastic.co/t/timezone-precedence-in-date-filter/196380/2 "2019-08-22T18:40:05Z")

</div>

You will get

```
"@timestamp" => 2019-08-22T17:00:00.000Z

```

It ignores the timezone option if the date includes the timezone, which it does.

---

<div class="post-metadata">

**Author:** ![DougR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dougr/32/48095_2.png) [@DougR](https://discuss.elastic.co/u/DougR)\
**Post date:** [August 22, 2019, 6:58pm UTC](https://discuss.elastic.co/t/timezone-precedence-in-date-filter/196380/3 "2019-08-22T18:58:03Z")

</div>

Thanks. That's what I thought the docs implied and that would've been my assumption anyway, but it's good to have a confirmation.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 19, 2019, 6:58pm UTC](https://discuss.elastic.co/t/timezone-precedence-in-date-filter/196380/4 "2019-09-19T18:58:10Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
