# How can I change timefield to have browser timezone using script?

**URL:** <https://discuss.elastic.co/t/how-can-i-change-timefield-to-have-browser-timezone-using-script/328502>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [March 24, 2023, 9:45pm UTC](https://discuss.elastic.co/t/how-can-i-change-timefield-to-have-browser-timezone-using-script/328502 "2023-03-24T21:45:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karlanakamura](https://avatars.discourse-cdn.com/v4/letter/k/bc79bd/32.png) [@karlanakamura](https://discuss.elastic.co/u/karlanakamura)\
**Post date:** [March 24, 2023, 9:45pm UTC](https://discuss.elastic.co/t/how-can-i-change-timefield-to-have-browser-timezone-using-script/328502/1 "2023-03-24T21:45:48Z")

</div>

Hello,

I'm using version 8.6.0 in elastic cloud.

I need to separate a timefield according to the day of the week. The way I'm doing it considers the UTC +00.00, but I would like it to be split according to the browser's timezone, how can I do that?

Here is the body of my data:

```auto
body: {
  "aggs": {
    "day_of_week": {
      "histogram": {
        "script": {
          "source": "return doc['my_date'].value.getDayOfWeekEnum().getValue();"
        },
        "interval": 1,
        "min_doc_count": 0,
        "extended_bounds": {
          "min": 1,
          "max": 7
        }
      }
    }
  }
}

```

---

<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:** [April 21, 2023, 9:46pm UTC](https://discuss.elastic.co/t/how-can-i-change-timefield-to-have-browser-timezone-using-script/328502/2 "2023-04-21T21:46:19Z")

</div>

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