• Post Reply Bookmark Topic Watch Topic
  • New Topic

java Date questions  RSS feed

 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Please let me know about this Date stuff in Java.Any good pointers.

2. If i have a Date string in UI, how is it converted to Java database Date object.

If i have on UI mm/dd/yy it's US format it will be saved with no problems.
But if I accept the date on my UI from user in European format, it's dd/mm/yy then how is it handled?
I have not worked before with so many details with Date object.
Please let me know.thanks.
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm using european date format (dd mm YYYY) and in MySql this field is DATE type: works fine

to format i use this:

[ May 27, 2005: Message edited by: miguel lisboa ]
 
Horatio Westock
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The simple answer is, look at java.text.SimpleDateFormat. It has parse and format methods which are handy for doing this sort of thing.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!