# Add field date problem

**URL:** https://discuss.elastic.co/t/add-field-date-problem/220665
**Category:** Logstash
**Created:** [February 24, 2020, 1:48pm UTC](https://discuss.elastic.co/t/add-field-date-problem/220665 "2020-02-24T13:48:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![samargh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samargh/32/70171_2.png) [@samargh](https://discuss.elastic.co/u/samargh)
#### Post date: [February 24, 2020, 1:48pm UTC](https://discuss.elastic.co/t/add-field-date-problem/220665/1 "2020-02-24T13:48:56Z")

</div>

i used this code to add a new column with a specific date  
mutate {  
add\_field =\> {"D"=\> ["2020-01-01"]}  
}  
it gives me the date but its adding minutes and hours  
Jan 1, 2020 @ 01:00:00.000 so is it normal ??  
but i wanted to declare it as a date  
i added this  
mutate {  
add\_field =\> {"D"=\> ["2020-01-01"]}  
}  
date {  
match =\> ["D", "YYYY-MM-dd"]  
target =\> "D"  
}  
it shows another wrong time  
so can u help i just need to add a column with the date 2020-01-01

---

<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: [February 24, 2020, 2:27pm UTC](https://discuss.elastic.co/t/add-field-date-problem/220665/2 "2020-02-24T14:27:16Z")

</div>

What timezone are you in?

---

<div class="post-metadata">

### Author: ![samargh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samargh/32/70171_2.png) [@samargh](https://discuss.elastic.co/u/samargh)
#### Post date: [February 24, 2020, 2:56pm UTC](https://discuss.elastic.co/t/add-field-date-problem/220665/3 "2020-02-24T14:56:39Z")

</div>

in fact i don't need the time to be shown  
i just need the date with no extention

---

<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: [February 24, 2020, 4:37pm UTC](https://discuss.elastic.co/t/add-field-date-problem/220665/4 "2020-02-24T16:37:31Z")

</div>

elasticsearch does not have a date type separate from the time. Date/time fields are stored as the number of milliseconds since the epoch.

---

<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: [March 23, 2020, 4:37pm UTC](https://discuss.elastic.co/t/add-field-date-problem/220665/5 "2020-03-23T16:37:35Z")

</div>

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