Wrong date format on DataSet.

Options
mdiez
edited February 11, 2022 in Analytics #1
<p>Hi,</p>
<p> </p>
<p>I'm new in BIRT reports and I am not able to fix date format. (I have version 2.6.0. )</p>
<p> </p>
<p>I get data from an excel with date format 'mm/dd/yyyy' but the format displayed on BIRT (on the previous results of the DataSet edit options) is 'yyyy/MM/dd'.</p>
<p> </p>
<p>The problem came with dates whose day is not greater than 12. In that cases if the date is 02/01/2016 (01 of february on my excel format), is converted to 2016/01/02 (02 of January).</p>
<p> </p>
<p>How can I fix that?</p>
<p> </p>
<p>Thanks in advanced and sorry for my English.</p>
<p> </p>
<p>Regards.</p>
<p> </p>
<p> </p>

Comments

  • <p><span style="font-family:'courier new', courier, monospace;"><strong>remember to use the correct case in the format...</strong></span></p>
    <p> </p>
    <p><span style="font-family:'courier new', courier, monospace;"><span style="font-size:14px;">In addition to that, maybe you can try something like:</span></span></p>
    <p> </p>
    <p><span style="font-family:'courier new', courier, monospace;"><span style="font-size:14px;">df = new java.text.SimpleDateFormat("dd/MM/yyyy");</span></span></p>
    <p><span style="font-family:'courier new', courier, monospace;"><span style="font-size:14px;">df.format(row["some_date"]);</span></span></p>
    <p> </p>
    <p><span style="font-family:'courier new', courier, monospace;"><span style="font-size:14px;"><strong>Or</strong> </span></span></p>
    <p> </p>
    <p><span style="font-family:'courier new', courier, monospace;"><span style="font-size:14px;">you might want to try looking at this (<a data-ipb='nomediaparse' href='http://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html'>http://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html</a>) for some additional DateFormat Class info.  </span></span></p>