# How to convert String to Timestamp

**URL:** <https://discuss.elastic.co/t/how-to-convert-string-to-timestamp/168793>\
**Category:** Logstash\
**Created:** [February 18, 2019, 9:29am UTC](https://discuss.elastic.co/t/how-to-convert-string-to-timestamp/168793 "2019-02-18T09:29:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![priya08](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@priya08](https://discuss.elastic.co/u/priya08)\
**Post date:** [February 18, 2019, 9:29am UTC](https://discuss.elastic.co/t/how-to-convert-string-to-timestamp/168793/1 "2019-02-18T09:29:03Z")

</div>

Hi ,

This is sample log statement  
[INFO]||datetime:20190218142929801+0530|hostname:sampleHostName|threadId:sampleThread|userId:null|className:SampleClass|methodName:samplemethod

I want to convert datetime(String) field to TimeStamp.  
I have tried with  
date {  
match =\> ["datetime", "YYYYMMddHHmmssSSSZZZ"]  
target =\> "datetime"  
}  
getting \_dateparsefailure in tags ,

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 18, 2019, 9:29am UTC](https://discuss.elastic.co/t/how-to-convert-string-to-timestamp/168793/2 "2019-02-18T09:29:57Z")

</div>

Please don't post the same question more than once, it makes it harder for people to help you 🙂

> [@How to convert yyyyMMddHHmmssSSSZ string into timestamp](https://discuss.elastic.co/t/how-to-convert-yyyymmddhhmmsssssz-string-into-timestamp/168596):
>
> Hi , I want to convert date string yyyyMMddHHmmssSSSZ to timezone , I have tried with date { match =\> ["datetime", "YYYYMMddHHmmssSSS"] target =\> "datetime" } but i am getting \_dateparsefailure in tags. How to convert this?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 18, 2019, 9:30am UTC](https://discuss.elastic.co/t/how-to-convert-string-to-timestamp/168793/3 "2019-02-18T09:30:00Z")

</div>


