# To\_char converted time error

**URL:** <https://discuss.elastic.co/t/to-char-converted-time-error/73635>\
**Category:** Logstash\
**Created:** [February 2, 2017, 6:17am UTC](https://discuss.elastic.co/t/to-char-converted-time-error/73635 "2017-02-02T06:17:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [February 2, 2017, 6:17am UTC](https://discuss.elastic.co/t/to-char-converted-time-error/73635/1 "2017-02-02T06:17:40Z")

</div>

Hi,

I am pulling rows from oracle db using the query;

```
SELECT request,response,reqtime,TO_CHAR(reqtime, 'DD-MM-YYYY hh:mi:ss.FF3 AM') as req_time,restime FROM logtable

```

The JSON I have found in kibana for the corresponding entry is;

```
{
  "_index": "myindex-2017-02-02",
  "_type": "logs",
  "_id": "AVn9cI2V2fWIWeet44y3",
  "_score": null,
  "_source": {
	"request": "get",
	"response": "0",
	"req_time": "12-12-2016 05:40:04.563 AM",
	"restime": "2016-12-12T00:10:04.597Z",
	"reqtime": "2016-12-12T00:10:04.563Z",
	"@timestamp": "2017-02-02T06:08:46.100Z",
	"@version": "1",
  },
  "fields": {
	"restime": [
	  1481501404597
	],
	"reqtime": [
	  1481501404563
	],
	"@timestamp": [
	  1486015726100
	]
  },
  "sort": [
	1481501404563
  ]
}

```

The error here is , `reqtime` and `restime` are correct, but `req_time` is incorrect. `reqtime` and `req_time` are suppose to be same, but in different display formats. When I triggered the same using SQL developer client, the times appear as same. I am using ELK stack GA 5.0.0. Why is this happening and how can I fix this?

Thank you.

---

<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 2, 2017, 6:19am UTC](https://discuss.elastic.co/t/to-char-converted-time-error/73635/2 "2017-03-02T06:19:06Z")

</div>

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