• Post Reply Bookmark Topic Watch Topic
  • New Topic

Date format  RSS feed

 
Samar Land
Ranch Hand
Posts: 68
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a question for date format.

what the difference between these two lines?

final String strDate = new SimpleDateFormat("yyyy-mm-dd ", Locale.US).format(new Date()); [failed my Junit test]]

final String strDate = new SimpleDateFormat("yyyy-mm-dd ").format(new Date());[[passed the test]]

My Databas type is DATE.
 
Knute Snortum
Sheriff
Posts: 4281
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first one uses the passed-in Locale and the second one uses the default Locale.

If you want to know why your JUnit test fails, post the error and we'll see what we can do.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!