<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: I can't import java.util.Date in script step, why?</title><link>https://answers.axonivy.com/questions/2489/i-can-t-import-java-util-date-in-script-step-why</link><description>&lt;p&gt;&lt;img alt="Import java.uti.date in script step" src="http://answers.axonivy.com/upfiles/import-java-util-date.png"&gt;&lt;/p&gt;
&lt;p&gt;I can't import java.util.Date, why?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/2489/i-can-t-import-java-util-date-in-script-step-why" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 06 Apr 2017 17:23:53 -0400</lastBuildDate><item><title>Answer by Stelt0</title><link>https://answers.axonivy.com/questions/2489/i-can-t-import-java-util-date-in-script-step-why/2577</link><description>&lt;p&gt;it is best to use the java 8 Date api&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Stelt0</dc:creator><pubDate>Thu, 06 Apr 2017 17:23:53 -0400</pubDate><guid>https://answers.axonivy.com/questions/2489/i-can-t-import-java-util-date-in-script-step-why/2577</guid></item><item><title>Answer by Alex Suter</title><link>https://answers.axonivy.com/questions/2489/i-can-t-import-java-util-date-in-script-step-why/2490</link><description>&lt;p&gt;The reason is, that already a date class is provided in the ivy script environement. If you import another date class, there will be an error: "The import java.util.Date collides with Date".&lt;/p&gt;
&lt;p&gt;We provide some utility classes from the package &lt;code&gt;ch.ivyteam.ivy.scripting.objects&lt;/code&gt; like &lt;code&gt;Date&lt;/code&gt;, &lt;code&gt;Time&lt;/code&gt;, &lt;code&gt;DateTime&lt;/code&gt; which should be more intuitive to use than the regulary java classes from the jdk like &lt;code&gt;java.util.Date&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You can still use &lt;code&gt;java.util.Date&lt;/code&gt; But you need to address the class with the fully qualified name. Like:
&lt;code&gt;java.util.Date date = new java.util.Date();&lt;/code&gt;. As you can think, some APIs requires &lt;code&gt;java.util.Date&lt;/code&gt;  as parameter and therefore its needed.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Suter</dc:creator><pubDate>Mon, 13 Mar 2017 08:24:55 -0400</pubDate><guid>https://answers.axonivy.com/questions/2489/i-can-t-import-java-util-date-in-script-step-why/2490</guid></item></channel></rss>