Re: How I can format a date to display

2003-06-27 Thread ara
Hi,Marc.

i use my custom tag.

!--  DateTag Definition  --
  tag
namedate/name
tagclassxx.yy.zz.view.taglibs.DateTag/tagclass
bodycontentempty/bodycontent
infoformat Data/info
attribute
  namesourceDate/name
  requiredfalse/required
  rtexprvaluetrue/rtexprvalue
/attribute
attribute
  namepattern/name
  requiredfalse/required
  rtexprvaluetrue/rtexprvalue
/attribute
attribute
  namename/name
  requiredfalse/required
  rtexprvaluetrue/rtexprvalue
/attribute
attribute
  nameproperty/name
  requiredfalse/required
  rtexprvaluetrue/rtexprvalue
/attribute
attribute
  namescope/name
  requiredfalse/required
  rtexprvaluetrue/rtexprvalue
/attribute
  /tag


- Original Message - 
From: "Marc BEGUIGNEAU" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 27, 2003 4:15 PM
Subject: How I can format a date to display


 Hello,
 
 With Struts, I'm using Torque to access a database
 under Oracle 9.
 
 The result of a search in an array of bean (values
 object bean).
 
 This bean as an property witch is a date. When I
 iterate this array in my JSP page, the date are
 displaying under US format (year/month/day). To format
 the display to french format (day/month/year), I
 convert the date to a string with the
 SimpleDateFormat, and then I parse the result string
 into a date and try to display it. But the result is a
 date with the FULL format.
 
 This is an extract of the code I use to convert:
 
 code
 
 SimpleDateFormat dateFormat = new
 SimpleDateFormat("dd/MM/");
 
 String tempDate =
 dateFormat.format("offer.getOfferDate");
 
 try {
 
 offerVO.setOfferDate(dateFormat.parse(tempDate));
 
 } catch (ParseException e) {
 System.out.println()e.toString();
 }
 
 /code
 
 My question is: how do you display date if you want to
 have a specific formating display?
 
 Curently, I have solv the problem by using a String
 property in my VO bean, but this solution is
 temporary.
 
 Thank you in advance.
 
 Marc
 

___
 Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en
fran
ais !
 Yahoo! Mail : http://fr.mail.yahoo.com
 

-
 To unsubscribe, e-mail:
[EMAIL PROTECTED]
 For additional commands, e-mail:
[EMAIL PROTECTED]
 


__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: How I can format a date to display

2003-06-27 Thread Sandeep Takhar
there are c:fmt tags in el.  I haven't used them
though...

sandeep
--- ara [EMAIL PROTECTED] wrote:
 Hi,Marc.
 
 i use my custom tag.
 
 !--  DateTag Definition  --
   tag
 namedate/name

 tagclassxx.yy.zz.view.taglibs.DateTag/tagclass
 bodycontentempty/bodycontent
 infoformat Data/info
 attribute
   namesourceDate/name
   requiredfalse/required
   rtexprvaluetrue/rtexprvalue
 /attribute
 attribute
   namepattern/name
   requiredfalse/required
   rtexprvaluetrue/rtexprvalue
 /attribute
 attribute
   namename/name
   requiredfalse/required
   rtexprvaluetrue/rtexprvalue
 /attribute
 attribute
   nameproperty/name
   requiredfalse/required
   rtexprvaluetrue/rtexprvalue
 /attribute
 attribute
   namescope/name
   requiredfalse/required
   rtexprvaluetrue/rtexprvalue
 /attribute
   /tag
 
 
 - Original Message - 
 From: Marc BEGUIGNEAU [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, June 27, 2003 4:15 PM
 Subject: How I can format a date to display
 
 
  Hello,
  
  With Struts, I'm using Torque to access a database
  under Oracle 9.
  
  The result of a search in an array of bean (values
  object bean).
  
  This bean as an property witch is a date. When I
  iterate this array in my JSP page, the date are
  displaying under US format (year/month/day). To
 format
  the display to french format (day/month/year), I
  convert the date to a string with the
  SimpleDateFormat, and then I parse the result
 string
  into a date and try to display it. But the result
 is a
  date with the FULL format.
  
  This is an extract of the code I use to convert:
  
  code
  
  SimpleDateFormat dateFormat = new
  SimpleDateFormat(dd/MM/);
  
  String tempDate =
  dateFormat.format(offer.getOfferDate);
  
  try {
  
  offerVO.setOfferDate(dateFormat.parse(tempDate));
  
  } catch (ParseException e) {
  System.out.println()e.toString();
  }
  
  /code
  
  My question is: how do you display date if you
 want to
  have a specific formating display?
  
  Curently, I have solv the problem by using a
 String
  property in my VO bean, but this solution is
  temporary.
  
  Thank you in advance.
  
  Marc
  
 

___
  Do You Yahoo!? -- Une adresse @yahoo.fr gratuite
 et en
 fran
 ais !
  Yahoo! Mail : http://fr.mail.yahoo.com
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
  
 
 
 __
 Do You Yahoo!?
 Yahoo! BB is Broadband by Yahoo! 
 http://bb.yahoo.co.jp/
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How I can format a date to display

2003-06-27 Thread Kris Schneider
If you can use JSTL:

c:forEach var=offerVO items=${offers}
  ...
  fmt:formatDate value=${offerVO.offerDate} pattern=dd/MM//
  ...
/c:forEach

Quoting Sandeep Takhar [EMAIL PROTECTED]:

 there are c:fmt tags in el.  I haven't used them
 though...
 
 sandeep
 --- ara [EMAIL PROTECTED] wrote:
  Hi,Marc.
  
  i use my custom tag.
  
  !--  DateTag Definition  --
tag
  namedate/name
 
  tagclassxx.yy.zz.view.taglibs.DateTag/tagclass
  bodycontentempty/bodycontent
  infoformat Data/info
  attribute
namesourceDate/name
requiredfalse/required
rtexprvaluetrue/rtexprvalue
  /attribute
  attribute
namepattern/name
requiredfalse/required
rtexprvaluetrue/rtexprvalue
  /attribute
  attribute
namename/name
requiredfalse/required
rtexprvaluetrue/rtexprvalue
  /attribute
  attribute
nameproperty/name
requiredfalse/required
rtexprvaluetrue/rtexprvalue
  /attribute
  attribute
namescope/name
requiredfalse/required
rtexprvaluetrue/rtexprvalue
  /attribute
/tag
  
  
  - Original Message - 
  From: Marc BEGUIGNEAU [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Friday, June 27, 2003 4:15 PM
  Subject: How I can format a date to display
  
  
   Hello,
   
   With Struts, I'm using Torque to access a database
   under Oracle 9.
   
   The result of a search in an array of bean (values
   object bean).
   
   This bean as an property witch is a date. When I
   iterate this array in my JSP page, the date are
   displaying under US format (year/month/day). To
  format
   the display to french format (day/month/year), I
   convert the date to a string with the
   SimpleDateFormat, and then I parse the result
  string
   into a date and try to display it. But the result
  is a
   date with the FULL format.
   
   This is an extract of the code I use to convert:
   
   code
   
   SimpleDateFormat dateFormat = new
   SimpleDateFormat(dd/MM/);
   
   String tempDate =
   dateFormat.format(offer.getOfferDate);
   
   try {
   
   offerVO.setOfferDate(dateFormat.parse(tempDate));
   
   } catch (ParseException e) {
   System.out.println()e.toString();
   }
   
   /code
   
   My question is: how do you display date if you
  want to
   have a specific formating display?
   
   Curently, I have solv the problem by using a
  String
   property in my VO bean, but this solution is
   temporary.
   
   Thank you in advance.
   
   Marc

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]