PDA

View Full Version : DateWrapper



fother
28 Aug 2009, 8:37 AM
public void onModuleLoad() {

System.out.println(new DateWrapper(1900, 1, 1).asDate()); // return Wed Jan 31 22:53:32 BRT 1900
System.out.println(new DateWrapper(2100, 11, 31).asDate()); // return Fri Dec 31 00:00:00 BRST 2100

}


if JAN equals 1 and DEC equals 11 ?????????

fother
28 Aug 2009, 8:42 AM
if use this in javascript



new Date(1900, 0, 1)


return Mon Jan 01 1900 00:00:00 GMT-0200

but in GXT return Sun Dec 31 22:53:32 BRT 1899

fother
28 Aug 2009, 8:57 AM
add this comment in javadoc.. :)

Allocates a Date object and initializes it so that it represents midnight, local time, at the beginning of the day specified by the year, month, and date arguments.

Parameters:
year - the year minus 1900.
month - the month between 0-11.
date - the day of the month between 1-31.