Friday, January 11, 2008

How to Get Date/Time in/with GWT

* get a unix time stamp since the epoch
* get year, month, today, date, hours, minutes seconds

//Get the browsers date (!!!note: I can't get gmt time zone in eclipse debugger)
Date date = new Date();
int Month = date.getMonth();
int Day = date.getDate();
int Year = date.getYear();
int Hour = date.getHours();
int min = date.getMinutes();
int sec = date.getSeconds();
int tz = date.getTimezoneOffset();
int UnixTimeStamp = (int) (date.getTime() * .001);

//get unix time stamp example (seconds)
Long lTimeStamp = date.getTime(); //time in milleseconds since the epoch
int iTimeStamp = (int) (lTimeStamp * .001); //(Cast) to Int from Long, Seconds since epoch
String sTimeStamp = Integer.toString(iTimeStamp); //seconds to string

//get the gmt date - will show tz offset in string in browser, not eclipse debug window
String TheDate = date.toString();

//render date to root panel in gwt
Label label = new Label(TheDate);

Sunday, January 6, 2008

GWT Code Examples

I have created a repository for my Google Web toolkit examples. I am using them to figure how things interact.

Here it is. Check it out.

Trying out the Dart Analysis Server

I wanted to see how the Dart Analysis Server was put together and worked. I started looking to see how I could wire it up and try out the co...