ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy Rouillier <guyr-...@burntmail.com>
Subject Re: mm/dd/yy format issue (urgent)
Date Wed, 07 Oct 2009 17:20:25 GMT
I think you may have missed the OP's question.  He's not concerned about 
  mm/dd vs. dd/mm.  Rather, he wants to be able to handle yy and yyyy.

At any rate, Clinton's response presents the appropriate solution.  Only 
the app can know if 09 represent 1909 or 2009, and the app should be 
passing iBatis Date objects, not strings.  To the OP, you'll probably 
use SimpleDateFormat to convert a string to a date.  You'll need to 
instances, one to handle yyyy and the other to handle yy.  If you do 
that, however, be aware that you are agreeing to use SimpleDateFormat's 
decision about what 09 means.

Jason H King wrote:
> This is a front-end issue.  There's no way iBatis or JPA or Hibernate can determine whether
the string "03/04/2009" represents a date in March or April.
> On the front end do browser sniffing to determine the language used and then convert
accordingly.
> Lets suppose 70% of your users are EN-us (mm/dd/yyyy) and 30% are EN-ca (dd/mm/yyyy).
 
> Check the browser settings, for the EN-ca folks flip the first and second numbers then
pass it to iBatis.
> If you're saying an individual user might do mm/dd/yyyy and dd/mm/yyyy intermittently
there is no way to consistently work around that.
> 
> --- supriyanaidupelluru@gmail.com wrote:
> 
> From: HelpMePlz <supriyanaidupelluru@gmail.com>
> To: user-java@ibatis.apache.org
> Subject: mm/dd/yy format issue (urgent)
> Date: Wed, 7 Oct 2009 04:13:52 -0700 (PDT)
> 
> 
> Hi all,
> 
> in my ibatis query , ihave to use both mm/dd/yyyy and mm/dd/yy . can you
> please tell me how can we do that. 
>  i have one question right now in my ibatis query i am using mm/dd/yyyy
> format if i have given date in that format  like 02/03/2009 i am getting
> results , if i changed the date format mm/dd/yy  like 02/03/09  by  giving
> this format i am not getting results .
> 
> if any one knows anws for these question plz reply me it is very urgent for
> me


-- 
Guy Rouillier

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message