java.sql.Timestamp into String in DD/MM/YY

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ashsa
    New Member
    • Feb 2007
    • 45

    java.sql.Timestamp into String in DD/MM/YY

    Hi all

    Is there any direct method to change a Timestamp got from the table into a String of the form (dd/mm/yy)?

    Or should i only have to do some String Manipulations to get it in the required format?

    Please do help with a snippet of code if any ..

    Many Thanks for any help
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Originally posted by ashsa
    Hi all

    Is there any direct method to change a Timestamp got from the table into a String of the form (dd/mm/yy)?

    Or should i only have to do some String Manipulations to get it in the required format?

    Please do help with a snippet of code if any ..

    Many Thanks for any help
    Have you looked into the documentation of a GregorianCalend ar object? (As Date objects no longer exist except as interfaces... :( ). Try using Google with something like "java date format". That should give you what you need. I'm also betting (although it is a different class) that you could find it by looking through the GregorianCalend ar documentation (though I'm not 100% sure).

    Anyway, yes there is a Java class that will format a Date to a specific pattern, to which you can load a string into it.

    Comment

    Working...