How to get the year of the current date ? Date manipulation ...

2010-03-19 Thread tim
Hi all, I would like to get the year of the current date, but this is not working : int year = Calendar.getInstance().get(Calendar.YEAR); How to use date in gwt ? Thanks in advance for your answer -- You received this message because you are subscribed to the Google Groups Google Web

Re: How to get the year of the current date ? Date manipulation ...

2010-03-19 Thread Joe Cole
new Date() :) On Mar 19, 9:04 pm, tim timor.su...@gmail.com wrote: Hi all, I would like to get the year of the current date, but this is not working : int year = Calendar.getInstance().get(Calendar.YEAR); How to use date in gwt ? Thanks in advance for your answer -- You received this

Re: How to get the year of the current date ? Date manipulation ...

2010-03-19 Thread Joe Cole
Apologies... int year = new Date().getYear() On Mar 19, 9:04 pm, tim timor.su...@gmail.com wrote: Hi all, I would like to get the year of the current date, but this is not working : int year = Calendar.getInstance().get(Calendar.YEAR); How to use date in gwt ? Thanks in advance for

Re: How to get the year of the current date ? Date manipulation ...

2010-03-19 Thread tim
Thanks for your answer. this is marked as deprecated and it's not the good value, that's not 2010. I would rather use a non-deprecated method. On Mar 19, 9:33 am, Joe Cole profilercorporat...@gmail.com wrote: Apologies... int year = new Date().getYear() On Mar 19, 9:04 pm, tim

Re: How to get the year of the current date ? Date manipulation ...

2010-03-19 Thread mariyan nenchev
Unfortunately GWT does not have support for Calendar class from the java api. I think you may use gwt DateTimeFormat and pass to it custom format with only the year(not sure if this is possible), and you will get the year as String. -- You received this message because you are subscribed to the

Re: How to get the year of the current date ? Date manipulation ...

2010-03-19 Thread Thomas Broyer
On Mar 19, 9:47 am, tim timor.su...@gmail.com wrote: Thanks for your answer. this is marked as deprecated and it's not the good value, that's not 2010. int year = 1900 + new Date().getYear(); I would rather use a non-deprecated method. A future version of GWT (that's already in trunk,

Re: How to get the year of the current date ? Date manipulation ...

2010-03-19 Thread kozura
And just for kicks, the JavaScript date class returns different values for older dates than the Java class, and neither of them deal well with older dates, time zones, and date manipulation anyway. But, for normal applications using modern dates in a standard, simple way it is adequate, and