# Date time to Date conversion

**URL:** <https://discuss.prometheus.io/t/date-time-to-date-conversion/1382>\
**Category:** PromQL\
**Created:** [January 5, 2023, 9:33am UTC](https://discuss.prometheus.io/t/date-time-to-date-conversion/1382 "2023-01-05T09:33:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![prometheus-dev](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@prometheus-dev](https://discuss.prometheus.io/u/prometheus-dev)\
**Post date:** [January 5, 2023, 9:33am UTC](https://discuss.prometheus.io/t/date-time-to-date-conversion/1382/1 "2023-01-05T09:33:41Z")

</div>

Hi,  
I want to display metrics based on the date range selected in the Grafana to fetch data from MongoDB.In the MongoDB the collection field is Date with format (2021-08-15T18:12:02.309+00:00) . Tried with  
“${\_\_to:date:yyyy-MM-dd HH:mm:ss}” in the Prometheus query but still no data on Grafana.Looks like the format is wrong.?
