# Problem when visualizing my custom date field

**URL:** https://discuss.elastic.co/t/problem-when-visualizing-my-custom-date-field/170761
**Category:** Kibana
**Created:** [March 4, 2019, 4:08pm UTC](https://discuss.elastic.co/t/problem-when-visualizing-my-custom-date-field/170761 "2019-03-04T16:08:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![HamiltonTM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hamiltontm/32/67672_2.png) [@HamiltonTM](https://discuss.elastic.co/u/HamiltonTM)
#### Post date: [March 4, 2019, 4:08pm UTC](https://discuss.elastic.co/t/problem-when-visualizing-my-custom-date-field/170761/1 "2019-03-04T16:08:08Z")

</div>

Hi,  
I have a mapping like this:

```
"queuedtime":{
    "type": "date",
    "format": "dd-HH:mm:ss||d-HH:mm:ss||HH:mm:ss"
}

```

It works, and when I make a sort query like this one:

```
GET /slurm/_search
{
    "sort":[
        {"queuedtime": "asc"}
    ]
}

```

Works too, that is, the value returned by elasticsearch is the expected, is something like:

```
{
    "_index" : "slurm",
    "_type" : "doc",
    "_id" : "1",
    "_score" : null,
    "_source" : {
      "queuedtime" : "04:29:09",
      "@timestamp" : "2019-02-09T19:44:04.569Z"
    },
    "sort" : [
      16149000
    ]
  }

```

The problem is when I try to visualize this field, or query it in Discover, Kibana adds a very old date to this field, the matter is not the old date, the thing is that I don't want that date, I just want the hour without any date at all. Also, it modifies the hour, so the showed hour is not the original one. What Kibana shows:  
January 2nd 1970, 23:29:09.000  
Is it possible to just visualize the time without date?.

Note: I tried what was explained in this issues:

> [@Visualizations using time only not date](https://discuss.elastic.co/t/visualizations-using-time-only-not-date/77955):
>
> I'm looking to create a graph that only uses the time data from my Date field which after going through a csv filter shows as February 28th 2017, 14:43:29.000 An being being able to see the time a user logs in over the period of a month. I'm sure i read that this can be done using a scripted field but unsure where to even start

But I don't want more fields.  
And this one:

> [@Time Field (Hours/Minutes) Format "HH:mm"](https://discuss.elastic.co/t/time-field-hours-minutes-format-hh-mm/68448):
>
> I need a field with HH:mm format. I mapped it in the index usgin a HH:mm Format : "hour\_start" : { "type" : "date", "format" : "HH:mm" } I retrieve the values from a semicolon separated values file : valueA;valueB;21:00;otherValues I use an exec input command cat on the file and hen a split filter. The time field is retrieved correctly but when the field is indexed it generates an error both in logstash and elasticsearch : MapperParsingException[failed to parse [hour\_start]]; nested: Illeg…

But it does not work as expected, Kibana is still adding the date to my field.

---

<div class="post-metadata">

### Author: ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)
#### Post date: [March 5, 2019, 6:10pm UTC](https://discuss.elastic.co/t/problem-when-visualizing-my-custom-date-field/170761/2 "2019-03-05T18:10:01Z")

</div>

Kibana can not support a date field that does not have year, month, and day. There is no way for kibana to know what year, month, and day the time occurs. You are seeing dates near January 1970 because time is represented as the number of seconds that have elapsed since 00:00:00 Thursday, 1 January 1970. Since the year, month, and day are not provided, they just default to zero.

You can either

1. populate the year, month, and day so the field is a valid date
2. if you really just want the hour of day, then store the field as a number in elasticsearch and only store the hour of day, or minute of day, or what ever meets your usecase

---

<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 2, 2019, 6:10pm UTC](https://discuss.elastic.co/t/problem-when-visualizing-my-custom-date-field/170761/3 "2019-04-02T18:10:18Z")

</div>

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