diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/server/WebBrowser.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/server/src/com/vaadin/server/WebBrowser.java b/server/src/com/vaadin/server/WebBrowser.java index 28b92e28b8..8038bbc207 100644 --- a/server/src/com/vaadin/server/WebBrowser.java +++ b/server/src/com/vaadin/server/WebBrowser.java @@ -319,6 +319,17 @@ public class WebBrowser implements Serializable { * entirely accurate due to varying network latencies, but should provide a * close-enough value for most cases. Also note that the returned Date * object uses servers default time zone, not the clients. + * <p> + * To get the actual date and time shown in the end users computer, you can + * do something like: + * + * <pre> + * WebBrowser browser = ...; + * SimpleTimeZone timeZone = new SimpleTimeZone(browser.getTimezoneOffset(), "Fake client time zone"); + * DateFormat format = DateFormat.getDateTimeInstance(); + * format.setTimeZone(timeZone); + * myLabel.setValue(format.format(browser.getCurrentDate())); + * </pre> * * @return the current date and time of the browser. * @see #isDSTInEffect() |