Home
Analytics
Date Parameter confuses the year for MM/DD/YY input to mean 19YY and not 20YY
democide
<p>I developed a BIRT report using Eclipse (Version: 3.7.1) which uses a single date parameter to query for records with a specific date. I used the function MXReportSqlFormat.getStartDayTimestampFunction in the report SQL statement to evaluate the date entered for the parameter. This is because the dates I'm querying for are just the date and not the date & time (time set to all zeros).</p>
<p> </p>
<p>What I noticed is that sometimes the date is not read correctly. For example, when I enter 1/1/50, the report uses the date "1/1/1950" in the report SQL statement. It is only when I enter the date as "1/1/2050" that it correctly uses the year I intended to use when I typed in "1/1/50." Is this a known issue within BIRT or Eclipse?</p>
<p> </p>
<p>Also, the BIRT report was created to be used within Maximo. In Maximo, the parameter is setup to use the <em>datelookup </em>to have a calendar picker to accurately select the date. Once the user selects 1/1/2015 (or 1/1/1950) from the calendar, it displays "1/1/50" and it works only when the date is "1/1/1950" for the record. But in Maximo, even if I type in "1/1/2050," it still uses "1/1/1950" so I cannot query for records with the date "1/1/2050."</p>
<p> </p>
<p>What can I do to resolve this? This is a big issue since all dates that will be queried for are future dates.</p>
<p> </p>
<p>Thanks in advance for your help.</p>
Find more posts tagged with
Comments
democide
<p>I did more testing within Eclipse. When I enter "1/1/35" the date used in the report SQL statement is "1/1/2035." When I enter "1/1/36" the date used is "1/1/1936." So it looks like the maximum year is 2035 before going back to the 1900's. </p>
<p> </p>
<p>Does anyone have any ideas on how to fix this?</p>
<p> </p>
<p>In Maximo, it disregards YYYY and only uses YY, and I want to use the <em>datelookup </em>calendar picker to avoid all the different date formats that an end-user might enter.</p>
Clement Wong
<p>Ideally, use yyyy instead of yy. Even in Excel, you'll see that, when using only 2 digits, there is a switch back from 2000s to 1900s.</p>
<p> </p>
<p><span style="font-family:'courier new', courier, monospace;">1/1/23 1/1/2023</span></p>
<p><span style="font-family:'courier new', courier, monospace;">1/1/24 <span style="font-family:'courier new', courier, monospace;"> </span>1/1/2024</span></p>
<p><span style="font-family:'courier new', courier, monospace;">1/1/25 <span style="font-family:'courier new', courier, monospace;"> </span>1/1/2025</span></p>
<p><span style="font-family:'courier new', courier, monospace;">1/1/26 <span style="font-family:'courier new', courier, monospace;"> </span>1/1/2026</span></p>
<p><span style="font-family:'courier new', courier, monospace;">1/1/27 <span style="font-family:'courier new', courier, monospace;"> </span>1/1/2027</span></p>
<p><span style="font-family:'courier new', courier, monospace;">1/1/28 <span style="font-family:'courier new', courier, monospace;"> </span>1/1/2028</span></p>
<p><span style="font-family:'courier new', courier, monospace;">1/1/29 <span style="font-family:'courier new', courier, monospace;"> </span>1/1/2029</span></p>
<p><span style="font-family:'courier new', courier, monospace;">1/1/30 <span style="font-family:'courier new', courier, monospace;"> </span>1/1/1930</span></p>
<p><span style="font-family:'courier new', courier, monospace;">1/1/31 <span style="font-family:'courier new', courier, monospace;"> </span>1/1/1931</span></p>
<p><span style="font-family:'courier new', courier, monospace;">1/1/32 <span style="font-family:'courier new', courier, monospace;"> </span>1/1/1932</span></p>
<p><span style="font-family:'courier new', courier, monospace;">1/1/33 <span style="font-family:'courier new', courier, monospace;"> </span>1/1/1933</span></p>
<p><span style="font-family:'courier new', courier, monospace;">1/1/34 <span style="font-family:'courier new', courier, monospace;"> </span>1/1/1934</span></p>
<p> </p>
<p>In Excel, it's a Windows Regional Date Setting to adjust the cutoff there.</p>
<p> </p>
<p>Now, what you are seeing is a Java related one:</p>
<p> </p>
<p><a data-ipb='nomediaparse' href='
http://stackoverflow.com/questions/36363972/java-mm-dd-yy-simple-date-datetimeformatter-not-working-for-greater-than-2037/36364135'>http://stackoverflow.com/questions/36363972/java-mm-dd-yy-simple-date-datetimeformatter-not-working-for-greater-than-2037/36364135</a></p>
;