# Time stamp change

**URL:** <https://discuss.elastic.co/t/time-stamp-change/44696>\
**Category:** Logstash\
**Created:** [March 17, 2016, 10:52am UTC](https://discuss.elastic.co/t/time-stamp-change/44696 "2016-03-17T10:52:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prateek\_Kshtriya](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@Prateek\_Kshtriya](https://discuss.elastic.co/u/Prateek_Kshtriya)\
**Post date:** [March 17, 2016, 10:52am UTC](https://discuss.elastic.co/t/time-stamp-change/44696/1 "2016-03-17T10:52:00Z")

</div>

Hi All ,

I am trying to feed in the log from past date using GROK but the date picked in @timestamp is getting changed by some month & year offset.  
Actual Date-2016-03-16 12:28:11AM  
Time stamp in elasticsearch - "@timestamp": "2016-01-17T06:58:11.000Z",  
Please let me know if I am missing something .  
Config file grok part;-  
grok {

```
        match => { "message" => "%{DATESTAMP:timestamp}" }
        }
	date {
        match => ["timestamp", "yy-MM-DD HH:mm:ss"]
        }

```

Regards,  
Prateek

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 17, 2016, 12:52pm UTC](https://discuss.elastic.co/t/time-stamp-change/44696/2 "2016-03-17T12:52:00Z")

</div>

Use yy-MM-dd, not yy-MM-DD. Quoting the [Joda-Time documentation](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html):

```nohighlight
y year year 1996
D day of year number 189
M month of year month July; Jul; 07
d day of month number 10

```

---

<div class="post-metadata">

**Author:** ![Prateek\_Kshtriya](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@Prateek\_Kshtriya](https://discuss.elastic.co/u/Prateek_Kshtriya)\
**Post date:** [March 18, 2016, 8:44am UTC](https://discuss.elastic.co/t/time-stamp-change/44696/3 "2016-03-18T08:44:35Z")

</div>

Thanks a lot. It worked perfectly.

---

<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:** [July 6, 2017, 5:06am UTC](https://discuss.elastic.co/t/time-stamp-change/44696/4 "2017-07-06T05:06:30Z")

</div>


