Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 2 weeks ago
RE: Can't get proper DateFormat field output
it returns me the complete format and I am needed to get in this (yyyy/MM/dd) format
What do you mean by this?
iirc a java.util.Date is returned. when you call dateField.getvalue();
Last updated on
I may not be understanding the question, but if you have a Date object and need to output it in some arbitrary format (month then day, or day then month, or 2 digits for year, etc), try using the SimpleDateFormat class.
For instance, this code:
SimpleDateFormat formatter =
new SimpleDateFormat("yyyy/MM/dd");
System.out.println(formatter.format(new Date()));
...outputs "2012/04/19" (at least, that's what it outputs today).
Cheers,
Bobby
Last updated on Apr, 19th 2012
You cannot reply to this thread.