You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Charles Honton (JIRA)" <ji...@apache.org> on 2013/04/29 18:52:16 UTC
[jira] [Commented] (LANG-891) working with multiple date Formats
return a wrong date for dd/mm/yy
[ https://issues.apache.org/jira/browse/LANG-891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13644641#comment-13644641 ]
Charles Honton commented on LANG-891:
-------------------------------------
The following test passes:
{code}
@Test
public void testLang891() {
final String pattern = "dd/MM/yyyy";
final FastDateFormat formatter= FastDateFormat.getInstance(pattern, NEW_YORK, Locale.US);
final Calendar cal= Calendar.getInstance(NEW_YORK, Locale.US);
cal.clear();
cal.set(2009, 10, 1);
assertEquals("01/11/2009", formatter.format(cal.getTime()));
cal.clear();
cal.set(2009, 10, 25);
assertEquals("25/11/2009", formatter.format(cal));
}
{code}
Is this issue a parsing or formatting failure? Please attach a unit test which demonstrates the failure.
> working with multiple date Formats return a wrong date for dd/mm/yy
> -------------------------------------------------------------------
>
> Key: LANG-891
> URL: https://issues.apache.org/jira/browse/LANG-891
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.time.*
> Affects Versions: 3.2
> Environment: Windows
> Reporter: Amit Lodha
> Priority: Critical
> Labels: date, dateutil, dd/mm/yy
> Original Estimate: 96h
> Remaining Estimate: 96h
>
> hi,
> while working with multiple date format, when i have date in format 25/11/09 i.e in dd/MM/yy it return me a wrong result.
> Previous Date: 01/11/09, Returned Date: 2009-01-11
> Previous Date: 25/11/09, Returned Date: 2011-01-11
> i was expecting my return date should be in yyyy-MM-dd format
> Other Formar Result:
> Previous Date: 25.11.2009, Returned Date: 2009-11-25
> Previous Date: 25.Nov.2009, Returned Date: 2009-11-25
> Previous Date: Nov.09, Returned Date: 2009-11-01
> Previous Date: Nov.2009, Returned Date: 2009-11-01
> Previous Date: 09.Nov, Returned Date: 2009-11-01
> Previous Date: Nov2509, Returned Date: 2009-11-25
> Previous Date: 2009-11-25, Returned Date: 2009-11-25
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira