• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

how can i reformat a Date object  RSS feed

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
i have a date object with date details and i want to reformat it from yyyyy-MM-dd format to dd/MM/yyyy format how can i do it?

10x ahead,
netanel
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Intermediate forum...
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should use java.text.SimpleDateFormat class for your purpose.
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright, import Date & DateFormat:


Now you'll create a Date & DateFormat object:


Now you'll format the Date with the DateFormatter:


The closest I could get you was to dd/MM/yy

I'll research around to find the answer!
[ August 01, 2004: Message edited by: Jack Kay ]
 
Jack Kay
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankur Srivastava was right.

[ August 01, 2004: Message edited by: Jack Kay ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!