File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Format a date represented as a String to another String representation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Format a date represented as a String to another String representation" Watch "Format a date represented as a String to another String representation" New topic
Author

Format a date represented as a String to another String representation

Fredrik Larsback
Greenhorn

Joined: Dec 21, 2009
Posts: 9
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
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Fredrik Larsback
Greenhorn

Joined: Dec 21, 2009
Posts: 9
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

Joined: Jun 25, 2001
Posts: 15641
    
  15

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

Joined: Dec 21, 2009
Posts: 9
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Format a date represented as a String to another String representation
 
Similar Threads
JDBC SQL server date format problem
How do I pad a timestamp string with 0s?
String to date format
how to convert String into Date format
Change format of date String-string