• Post Reply Bookmark Topic Watch Topic
  • New Topic

converting epoch time to human readable format using JSF  RSS feed

 
terry Kiernan
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I have the following in my xhtml 1.0 trying to convert epoch timestamp say " 1327486488 676088 "



But it is not converting the timestamp for me ....

Any ideas what i am doing wrong ?



 
Tim Holloway
Bartender
Posts: 18663
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The time-since-epoch is an internal long-integer variable to the java.util.Date, java.sql.Date and java.util.Calendar classes (assuming I remembered their package names correctly).

The JSF dateTimeConverter will automatically convert to/from a date object, but if your time is naked (long, int or String), the dateTimeConverter can't handle that. You'll need to wrap it in a date object.
 
terry Kiernan
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim ,

Can you show me an example how to wrap it in the Date object ?

 
Tim Holloway
Bartender
Posts: 18663
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!