# Problem in editing @timestamp through ingest pipeline

**URL:** https://discuss.elastic.co/t/problem-in-editing-timestamp-through-ingest-pipeline/365491
**Category:** Elasticsearch
**Tags:** painless, ingest-pipeline
**Created:** [August 24, 2024, 1:32pm UTC](https://discuss.elastic.co/t/problem-in-editing-timestamp-through-ingest-pipeline/365491 "2024-08-24T13:32:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![fardadmh](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@fardadmh](https://discuss.elastic.co/u/fardadmh)
#### Post date: [August 24, 2024, 1:32pm UTC](https://discuss.elastic.co/t/problem-in-editing-timestamp-through-ingest-pipeline/365491/1 "2024-08-24T13:32:45Z")

</div>

Hello there.

I've been trying to manipulate @timestamp through a script in a ingest pipeline (substract 8 hours). I tried referencing @timestamp using this syntax:

`ctx._source['@timestamp'] = ctx._source['@timestamp'].minusHours(8);`

I used these links to come up with a solution but had no luck yet.

> **[java.time.ZonedDateTime Class in Java - GeeksforGeeks](https://www.geeksforgeeks.org/java-time-zoneddatetime-class-in-java/)**
>
> A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.

> **[Using Datetime in Painless | Painless Scripting Language \[8.15\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-datetime.html)**

Is there anything I've been missing? Any comment or idea would be much appreciated.

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [August 24, 2024, 1:35pm UTC](https://discuss.elastic.co/t/problem-in-editing-timestamp-through-ingest-pipeline/365491/2 "2024-08-24T13:35:56Z")

</div>

Is this to convert to some timezone? Because you could use the date processor to do that.

---

<div class="post-metadata">

### Author: ![fardadmh](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@fardadmh](https://discuss.elastic.co/u/fardadmh)
#### Post date: [August 24, 2024, 1:37pm UTC](https://discuss.elastic.co/t/problem-in-editing-timestamp-through-ingest-pipeline/365491/3 "2024-08-24T13:37:04Z")

</div>

Thanks for your reply.  
No actually I need to manipulate the timedate itself. It's not a timezone issue in this particular scenario.
