# 5.0 - Comparing dates in painless

**URL:** <https://discuss.elastic.co/t/5-0-comparing-dates-in-painless/63943>\
**Category:** Elasticsearch\
**Created:** [October 25, 2016, 10:57pm UTC](https://discuss.elastic.co/t/5-0-comparing-dates-in-painless/63943 "2016-10-25T22:57:42Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![niemyjski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/niemyjski/32/5189_2.png) [@niemyjski](https://discuss.elastic.co/u/niemyjski)\
**Post date:** [January 3, 2017, 8:40pm UTC](https://discuss.elastic.co/t/5-0-comparing-dates-in-painless/63943/20 "2017-01-03T20:40:29Z")

</div>

> [@niemyjski](#):
>
> DateTimeFormatter.ISO\_INSTANT

@Jack_Conradson I'm now trying to work on a painless script (for daily index migration ) and I have a date stored as `'2017-01-03T14:12:36.2770782-06:00'` Is there a good way to get the utc time? I'm back to trying to parse this with out very much luck.. I've tried to convert the doc.date to a date and instant and get errors [5.0.0-rc Painless support for working with dates · Issue #21121 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/21121) converting long to java long..

---

_[View the full topic](https://discuss.elastic.co/t/5-0-comparing-dates-in-painless/63943)._
