# Timezone parameter has no impact in Date filter plugin

**URL:** <https://discuss.elastic.co/t/timezone-parameter-has-no-impact-in-date-filter-plugin/282935>\
**Category:** Logstash\
**Created:** [August 31, 2021, 3:05pm UTC](https://discuss.elastic.co/t/timezone-parameter-has-no-impact-in-date-filter-plugin/282935 "2021-08-31T15:05:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![6igwig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/6igwig/32/88971_2.png) [@6igwig](https://discuss.elastic.co/u/6igwig)\
**Post date:** [August 31, 2021, 3:05pm UTC](https://discuss.elastic.co/t/timezone-parameter-has-no-impact-in-date-filter-plugin/282935/1 "2021-08-31T15:05:22Z")

</div>

TLDR: my timestamp value is already in UTC, I am trying to prevent elastic from converting it to UTC **again**.

I am using the JDBC input in logstash to query a SQL server database. When I look at a specific record in SQL Server Management Studio the date is "2021-07-08 **15** :35:09.057".

Here is my logstash config file

```auto
input {
  jdbc {
    ...
    statement => "SELECT 
        [TimeStamp] as parsethis
        ...
  }
}

filter {
  mutate {
    convert => {
      "parsethis" => "string"
    }
  }
  date {
    match => ["parsethis", "ISO8601"]
    target => "parsedUTC"
    timezone => "UTC"
  }
  date {
    match => ["parsethis", "ISO8601"]
    target => "parsedEST"
    timezone => "EST5EDT"
  }
}

```

In Dev Tools, here is the record:

```auto
        "_source" : {
          "parsethis" : "2021-07-08T19:35:09.057Z",
          "parsedEST" : "2021-07-08T19:35:09.057Z",
          "parsedUTC" : "2021-07-08T19:35:09.057Z"
        }

```

Notice how the parsedEST and parsedUTC fields above have the exact same value. What I would expect (and what I need) is for one of the values to be 2021-07-08 **15** :35:09.057 which is the original value in the SQL database.

I understand that elasticsearch wants to store date values in UTC. I don't understand how I am supposed to tell elasticsearch that the value is already in UTC and not to convert it to that again.

Why does this method not work? What is the correct way to address this?

---

<div class="post-metadata">

**Author:** ![6igwig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/6igwig/32/88971_2.png) [@6igwig](https://discuss.elastic.co/u/6igwig)\
**Post date:** [August 31, 2021, 3:24pm UTC](https://discuss.elastic.co/t/timezone-parameter-has-no-impact-in-date-filter-plugin/282935/2 "2021-08-31T15:24:49Z")

</div>

I think I have solved the problem I was having.

In the JDBC input I added this line: jdbc\_default\_timezone =\> "UTC"

That converted all the time values to 15:...

I still don't understand the point of the timezone parameter in the data filter plugin since it is seemingly has no effect.

---

<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 31, 2021, 4:10pm UTC](https://discuss.elastic.co/t/timezone-parameter-has-no-impact-in-date-filter-plugin/282935/3 "2021-08-31T16:10:35Z")

</div>

> [@6igwig](#):
>
> I still don't understand the point of the timezone parameter in the data filter plugin since it is seemingly has no effect.

It has no effect because the timezone is specified in the date string itself. The Z at the end of the strings mean they are in Zulu, or UTC timezone. You cannot override that with the timezone option.

---

<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 28, 2021, 4:11pm UTC](https://discuss.elastic.co/t/timezone-parameter-has-no-impact-in-date-filter-plugin/282935/4 "2021-09-28T16:11:12Z")

</div>

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