I'm working on an existing GWT app . I'm seeing this warning
the constructor Date(int, int, int) is deprecated
Since java.util.Calendar is not supported in GWT client side , I'm looking for how to replace this methode .
I'm working on an existing GWT app . I'm seeing this warning
the constructor Date(int, int, int) is deprecated
Since java.util.Calendar is not supported in GWT client side , I'm looking for how to replace this methode .
There's no replacement for GWT (for now at least, java.time
support/emulation should come some time in the future). Just put @SuppressWarnings("deprecation")
if you want to get rid of the warning.
I believe this will help answer your question.
You can use the Calendar.set()
and Calendar.get()
methods to set/get the date.
Use always Calendar (GregorianCalendar would suit what you need). And when you need to turn it into a Date object, use Calendar.getTime()
This page has examples: http://www.mkyong.com/java/java-date-and-calendar-examples/