| Author |
date to string
|
Janardan Kelkar
Ranch Hand
Joined: May 05, 2008
Posts: 69
|
|
how do i get the current system date, and convert it to string, example, i want to generate the following string: "28/08/2008" i tried using calendar class and all, but have not been able to still figure it out properly..
|
When the compiler's not happy, ain't nobody happy.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32712
|
|
|
At least two ways to do it:You can use the SimpleDateFormat class or similar and use that to format the output.Use the tags of the Formatter class, which reappear in several locationsExample of the latter: String.format("%Td/%<TB/%<Ty", myDate) which won't give the format you are asking about.
|
 |
Janardan Kelkar
Ranch Hand
Joined: May 05, 2008
Posts: 69
|
|
k....thanks
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32712
|
|
You're welcome
|
 |
 |
|
|
subject: date to string
|
|
|