# Date format difference when adding excel as test data in Katalon

**URL:** <https://forum.katalon.com/t/date-format-difference-when-adding-excel-as-test-data-in-katalon/63607>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [March 23, 2022, 10:01am UTC](https://forum.katalon.com/t/date-format-difference-when-adding-excel-as-test-data-in-katalon/63607 "2022-03-23T10:01:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![windflower](https://avatars.discourse-cdn.com/v4/letter/w/b9bd4f/32.png) [@windflower](https://forum.katalon.com/u/windflower)\
**Post date:** [March 23, 2022, 10:01am UTC](https://forum.katalon.com/t/date-format-difference-when-adding-excel-as-test-data-in-katalon/63607/1 "2022-03-23T10:01:00Z")

</div>

I’m new in Katalon, I’ve created an excel file with the following date/time format:  
 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/f/1/f1316a226892094135e17e36519bcca9d21ccdf8.png)

But when I add the excel as test data in Katalon, it’s showing different format:

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/6/4/6409ffd948cd4bdaf5132d0dd97b6baffdbca395.png)

The test failed because of mismatched date/time format

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/e/6/e61a6f1280136133f7ea519daed42617f27e3824.png)

How can I make Katalon to have the same date/time format after adding as test data?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [March 23, 2022, 11:09am UTC](https://forum.katalon.com/t/date-format-difference-when-adding-excel-as-test-data-in-katalon/63607/2 "2022-03-23T11:09:32Z")

</div>

Katalon’s “Data-driven testing” feature does not respect what type of datetime format you specified for each cells in a .xlsx file. KS just ignores the datetime format defined in a \*.xlsx file. KS applies a datetime format it considers appropriate as default.

You should do either of

1. change your test so that it follows the datetime format that KS applied.

or

1. Don’t let KS to read an Excel file. Let it read a CSV file instead. You want to export the Excel worksheet into a CSV file. You want to make sure the datetime value is formatted in the format you want, like this:

```auto
Name,Start Time ,Start Time ,Duration,,,
WOW01A01,2021-04-20 8:36:07,2021-04-20 11:27:47,,,,
...

```

and you want to configure Katalon to load the CSV file, not .xlsx file, as Data.

* * *

If you definitely want to use the datetime format defined in the cells of \*.xlsx file, and you do not like CSV file, then you have to stop using the Katalon’s “Data-driven testing”. You can invent your own way of importing Excel data directly from \*.xlsx file while respecting the datetime format of cells using Apache POI, though I would not recommend it, it’s just cumbersome. Too much efforts required for too little benefit.

---

<div class="post-metadata">

**Author:** ![danpoleary](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/danpoleary/32/2416_2.png) [@danpoleary](https://forum.katalon.com/u/danpoleary)\
**Post date:** [March 23, 2022, 11:58am UTC](https://forum.katalon.com/t/date-format-difference-when-adding-excel-as-test-data-in-katalon/63607/3 "2022-03-23T11:58:27Z")

</div>

We also use Excel for data that includes date, You can:

1. Store the date as text in the spreadsheet in the format you want.

2. We stored as date format which when read is the number of days since Jan 0, 1990, so convert to a date string.

3. We also use datetime format which when read is as above with a decimal value representing fraction of a day. This we also convert, Please see [https://www.excelcampus.com/functions/how-dates-work-in-excel/#:~:text=The%20dates%20in%20Excel%20are,1%2F27%2F2016](https://www.excelcampus.com/functions/how-dates-work-in-excel/#:~:text=The%20dates%20in%20Excel%20are,1%2F27%2F2016)). for details.
