For Programmers: Free Programming Magazines  


Home > Archive > Java Help > August 2005 > convert sql date









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author convert sql date
shoa

2005-08-21, 9:56 pm

Hello

I have a sql Date with the format yyyy-MM-dd. To show the birthday date of a
staff in JTextField, I did as

birthdayTextField.setText(staff.getBirthdayDate().toString); //I can get
1979-12-15


However, I want to display the date with the format of dd/MM/yyyy // such
as 15/12/1979

It can be seen that I can use a normal way: get the last four numbers and
put in front.... and so on.

Any suggestion for a faster way to do this converter?
Thanks
S.Hoa


Andrew Thompson

2005-08-21, 9:56 pm

On Mon, 22 Aug 2005 13:22:34 +1200, shoa wrote:

(format dates)
> Any suggestion for a faster way to do this converter?


java.text.DateFormat

HTH

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"If no one out there understands, start your own revolution and cut out the
middle man."
Billy Bragg 'Waiting For The Great Leap Forward'
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com