Re: Extracting the year from a Date() object

2010-06-10 Thread Thomas Broyer
On 10 juin, 17:05, Eric wrote: > On Jun 10, 6:31 am, Thomas Broyer wrote: > > > On 8 juin, 16:29, Eric wrote: > > > Sadly, the best method is to use GWT's DateTimeFormat: > > > > private static final DateTimeFormat YEAR_FORMAT = > > > DateTimeFormat.getFormat(""); > > > public static int y

Re: Extracting the year from a Date() object

2010-06-10 Thread Eric
On Jun 10, 6:31 am, Thomas Broyer wrote: > On 8 juin, 16:29, Eric wrote: > > Sadly, the best method is to use GWT's DateTimeFormat: > > > private static final DateTimeFormat YEAR_FORMAT = > > DateTimeFormat.getFormat(""); > > public static int year(final Date date) { > >   return Integer.p

Re: Extracting the year from a Date() object

2010-06-10 Thread Thomas Broyer
On 8 juin, 16:29, Eric wrote: > On Jun 7, 7:58 pm, Rob Tanner wrote: > > > I have a Date() object that holds a date of birth and I want to > > extract the year and make sure no one's trying to tell me they're 150 > > years old, etc.  The getYear method of the Date() class is deprecated > > and

Re: Extracting the year from a Date() object

2010-06-08 Thread Erik Uzureau
I am curious as to why folks wouldn't just use date.getYear() + 1900; There was a post[1] not to long ago that I replied to (inadvertently 3 times) essentially suggesting the above, but nobody followed up so I'm wondering if I'm not on the right track. In a nutshell: 1) The GWT date obj

Re: Extracting the year from a Date() object

2010-06-08 Thread Eric
On Jun 7, 7:58 pm, Rob Tanner wrote: > I have a Date() object that holds a date of birth and I want to > extract the year and make sure no one's trying to tell me they're 150 > years old, etc.  The getYear method of the Date() class is deprecated > and you normally use a Calendar() to get the ye

Re: Extracting the year from a Date() object

2010-06-07 Thread Jeff Chimene
On 06/07/2010 04:58 PM, Rob Tanner wrote: > I have a Date() object that holds a date of birth and I want to > extract the year and make sure no one's trying to tell me they're 150 > years old, etc. The getYear method of the Date() class is deprecated > and you normally use a Calendar() to get the

Extracting the year from a Date() object

2010-06-07 Thread Rob Tanner
I have a Date() object that holds a date of birth and I want to extract the year and make sure no one's trying to tell me they're 150 years old, etc. The getYear method of the Date() class is deprecated and you normally use a Calendar() to get the year. The problem is that when I try to use a Cal