# Katalon Studio 7.9 rc - Bug in Date().format(\<String\>)

**URL:** <https://forum.katalon.com/t/katalon-studio-7-9-rc-bug-in-date-format-string/51126>\
**Category:** Bug Report\
**Tags:** katalon-studio, bugs-report\
**Created:** [January 15, 2021, 12:43pm UTC](https://forum.katalon.com/t/katalon-studio-7-9-rc-bug-in-date-format-string/51126 "2021-01-15T12:43:13Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [January 16, 2021, 7:31am UTC](https://forum.katalon.com/t/katalon-studio-7-9-rc-bug-in-date-format-string/51126/6 "2021-01-16T07:31:09Z")

</div>

I have found the solution for the aforementioned “date.format(String)” problem.

ANSWER: _Katalon Studio 7.9.x needs to bundle the jar file of [`groovy-dateutil`](https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-dateutil) in the Katalon Studio distributable._

* * *

Let me tell you what I have found.

I used Katalon Studio 7.9.0-rc to study.

I wrote a Test Case script as follows:

```auto
import org.apache.groovy.dateutil.extensions.DateUtilExtensions

println(Date.class.getResource(Date.class.getSimpleName() + '.class'))

println(DateUtilExtensions.class.getResource(DateUtilExtensions.class.getSimpleName() + '.class'))

Date now = new Date()
System.out.println(now.format("yyyyMMdd_HHmmss"))

```

In the bare KS 7.9.0, this code does not even compile as the following screenshot shows:

 ![UnableToResolveClassDateUtilExtensions](https://europe1.discourse-cdn.com/katalon/original/2X/5/51c439407ba4c667fed0b7115d0a12af635f5bef.png)

The error message says

```auto
1: unable to resolve class org.apache.groovy.dateutil.extensions.DateUtilExtensions
 @ line 1, column 1.
   import org.apache.groovy.dateutil.extensions.DateUtilExtensions
   ^

```

What is the `DateUtilExtensions` class? See the Groovy API doc:

> **[DateUtilExtensions (Groovy 3.0.0)](http://docs.groovy-lang.org/docs/groovy-3.0.0/html/api/org/apache/groovy/dateutil/extensions/DateUtilExtensions.html#format-java.util.Date-java.lang.String-)**
>
> The map values are the normal values provided as the second parameter to java.util.Calendar#set(int, int). The keys can either be the normal fields values provided as the first parameter to that method or one of the following Strings:

> This class defines new groovy methods which appear on normal JDK Date and Calendar classes inside the Groovy environment.

The `date.format(String)` is defined by this DataUtilExtensions class. So we need its implementation class to be included in the runtime classpath in Katalon Studio 7.9.0.

In which jar this class is included? — There is a jar named `groovy-dateutil`

- [https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-dateutil](https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-dateutil)

According to the history info on Maven Central, the groovy-dateutil package was created as of Groovy-2.5.0. On the other hand, Katalon Studio 7.8 and older uses Groovy 2.4.7, and it uses `groovy-all-2.4.7.jar`. As of Groovy 2.5.0, the `groovy-all-x.x.x.jar` is not distributed any longer. Katalon Team has to choose which `groovy-XXX.jar` to bundle in the Katalon Studio 7.9.0-rc distributable. I was informed of this background before in [this post](http://forum.katalon.com/t/issue-while-writing-on-excel-file-with-parallel-execution/50084/12).

I suspect that Katalon Team just forgot to include the `groovy-dateutil.jar`.

I downloaded the `groovy-dateutil-3.0.7.jar` from the Maven Central and saved in the `Drivers` directory of my Katalon project. Restarted KS. Then the test case script successfully compiled and ran OK.

* * *

## Lesson learned

It is likely that Katalon Studio 7.9.0-rc misses some other groovy-XXXX.jar files which are essential and mandatory. Therefore we may see more cases where Groovy 3.0 behaves strange in KS 7.9.0-rc.

---

_[View the full topic](https://forum.katalon.com/t/katalon-studio-7-9-rc-bug-in-date-format-string/51126)._
