# Verify date format 'YYYY-MM-DDTHH:mm:ss:sssZ'

**URL:** <https://community.postman.com/t/verify-date-format-yyyy-mm-ddthhss-sssz/37307>\
**Category:** Help Hub\
**Created:** [July 18, 2022, 7:09pm UTC](https://community.postman.com/t/verify-date-format-yyyy-mm-ddthhss-sssz/37307 "2022-07-18T19:09:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![QA\_2022](https://avatars.discourse-cdn.com/v4/letter/q/91b2a8/32.png) [@QA\_2022](https://community.postman.com/u/QA_2022)\
**Post date:** [July 18, 2022, 7:09pm UTC](https://community.postman.com/t/verify-date-format-yyyy-mm-ddthhss-sssz/37307/1 "2022-07-18T19:09:19Z")

</div>

Hi guys, I’m trying to check a date format in the response body, but without success. How can I take the test?

I’ve already tried

```auto
var jsonData = pm.response.json();

var date = jsonData.dataExpurgo;

var moment = require ('moment');

pm.test("Checking data format", function () {
    pm.expect(date).to.include(moment(date).format('YYYY-MM-DDTHH:mm:ss:sssZ'));
});

```

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [July 19, 2022, 7:34am UTC](https://community.postman.com/t/verify-date-format-yyyy-mm-ddthhss-sssz/37307/2 "2022-07-19T07:34:54Z")

</div>

Hi @QA_2022

Have a look at these;

* * *

> [@Check format date with Postman](https://community.postman.com/t/check-format-date-with-postman/28359):
>
> Hello slight_smile I want to create a test that validates if the date format respects this: YYYY-MM-DD in the body I have this answer: “date”: “2021-10-29” help me please

* * *

> [@Verify a date format from a post response](https://community.postman.com/t/verify-a-date-format-from-a-post-response/11046):
>
> Hello all, I have created a post request which basically adds a user and an ID, when the response returns, it also passes back a date. so response body looks like this. From BODY { "data": { "name": "Fred Dibner", "date": "27-02-2020 01:08:51" }, "result": "32" } In the test, I have written let moment = require ('moment'); pm.test("Date is present in correct format", function () { pm.expect(jsonData.data.date).to.include(moment().format('DD-MM-YYYY hh:mm:ss…
