Re: Timezone offset in GWT

2009-12-15 Thread Chris Lowe
Hi Vikas,

Have a look here:

http://groups.google.com/group/google-web-toolkit/browse_thread/thread/6e39577098a87d9f/5bd043c41dc7d37c?q=

The method from the second post should get you what you need.

Cheers,

Chris.


On Dec 14, 1:28 pm, Vikas vikas.m.ya...@gmail.com wrote:
 How to get timezone offset in GWT?

 In Java we're getting timezone offset by following way, but this is
 not possible in GWT because Java's 'Calendar' object is not accessible
 in GWT.

     public static int getOffsetDiff()
     {
         final Calendar cal = Calendar.getInstance(TimeZone.getDefault
 ());
         return (cal.get(Calendar.ZONE_OFFSET) + cal.get
 (Calendar.DST_OFFSET)) / 1000;
     }

 Thanks in advance,
 Vikas

--

You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.




Timezone offset in GWT

2009-12-14 Thread Vikas
How to get timezone offset in GWT?

In Java we're getting timezone offset by following way, but this is
not possible in GWT because Java's 'Calendar' object is not accessible
in GWT.

public static int getOffsetDiff()
{
final Calendar cal = Calendar.getInstance(TimeZone.getDefault
());
return (cal.get(Calendar.ZONE_OFFSET) + cal.get
(Calendar.DST_OFFSET)) / 1000;
}

Thanks in advance,
Vikas

--

You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.