# Date format in .csv file

**URL:** <https://community.postman.com/t/date-format-in-csv-file/15810>\
**Category:** Help Hub\
**Tags:** csvdatafile\
**Created:** [September 12, 2020, 12:07pm UTC](https://community.postman.com/t/date-format-in-csv-file/15810 "2020-09-12T12:07:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aakashjain8693](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@aakashjain8693](https://community.postman.com/u/aakashjain8693)\
**Post date:** [September 12, 2020, 12:07pm UTC](https://community.postman.com/t/date-format-in-csv-file/15810/1 "2020-09-12T12:07:47Z")

</div>

Hi Team,  
I am using the .csv file for data driven approach whereas wanted to verify the date, How I can achieve in terms of consistent way.

I am using the below method but always need manual intervention.  
1.Response file-

```auto
{
    "nextScheduledPremierOrder": {

        "scheduledOn": "2020-09-10 03:58:39.000000",
}}

```

1. Postman script

```auto
pm.test("data verification", function () {
 let jsonData = pm.response.json();
 pm.expect(jsonData.nextScheduledPremierOrder.scheduledOn).to.include((data.nextScheduledPremierOrderscheduledOn));
});

```

1. .csv file  
Enter the date in respective column, Format the cell with required format.  
steps
2. Entering the date whereas bydeafult value can see as 09-10-2020
3. format the cell with required format that is 2020-09-10

Now if I close the sheet and again run the script it will fail.  
can we use any function?

---

<div class="post-metadata">

**Author:** ![singhsivcan](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/singhsivcan/32/1595_2.png) [@singhsivcan](https://community.postman.com/u/singhsivcan)\
**Post date:** [September 14, 2020, 6:37am UTC](https://community.postman.com/t/date-format-in-csv-file/15810/2 "2020-09-14T06:37:28Z")

</div>

You can utilize moment library to achieve the transformation of dates and then perform your tests over the transformed dates.

@danny-dainton has written a great article around how to use moment in postman: [https://dannydainton.com/2018/05/21/hold-on-wait-a-moment/](https://dannydainton.com/2018/05/21/hold-on-wait-a-moment/)

---

<div class="post-metadata">

**Author:** ![aakashjain8693](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@aakashjain8693](https://community.postman.com/u/aakashjain8693)\
**Post date:** [September 27, 2020, 6:03pm UTC](https://community.postman.com/t/date-format-in-csv-file/15810/3 "2020-09-27T18:03:06Z")

</div>

Thanks, Able to utilize date functions from above link.
