• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Format a date represented as a String to another String representation

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do I format a date string to a string with another format with JSF?

E.g.
Format "20100224091007.000000Z" to "2010-02-24 09:10:07"

Regards
/Fredrik
 
Saloon Keeper
Posts: 25477
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you expecting JSF to do? Your example is just free-floating data without any context. You're describing a process that can be done without JSF or even any web application at all.
 
Fredrik Larsback
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:What are you expecting JSF to do? Your example is just free-floating data without any context. You're describing a process that can be done without JSF or even any web application at all.



I have a Seam application which reads a date as a string from a backing bean which is packaged in a jar which can't be modified. I'd like to know if there is way to format this date-String to another format in my .xhtml page through some tag library like <f:convertDateTime> or should a write my own facelet tag library to achive this?
 
Tim Holloway
Saloon Keeper
Posts: 25477
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe that's within the capabilities of the JSF Converter architecture. A Converter basically has 2 methods in it (inbound and outbound conversions), and is typically registered in the faces-config file, where you bind the actual converter class to a logical converter name for use in converter tags.
 
Fredrik Larsback
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:I believe that's within the capabilities of the JSF Converter architecture. A Converter basically has 2 methods in it (inbound and outbound conversions), and is typically registered in the faces-config file, where you bind the actual converter class to a logical converter name for use in converter tags.



Ok, thanks. Then I'll write a converter.
 
Thank you my well lotioned goddess! Here, have my favorite tiny ad!
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic