Hi,
I am totally confused.
On SmartGWT Pro 2.4 I have a server-side datasource containing a field:
On my client I use the following code to display everything in german locale and timezone:
On the server-side the Date is read as a java.sql.date from the database containing April 11th 1978, 00:00:00 CET.
This is converted to UTC when transferred to the client: April 10th 1978, 23:00:00 UTC which ist totally correct. But when debugging my date-formatter above I recognized that the date that is passed to it is April 10th 1978, 23:00:00 CET and therefore the date displayed is "10.04.1978".
What am I doing wrong? Is there a way to stop SmartGWT from setting the CET-timezone on the UTC-date on client-side?
I found a lot of related posts in the forum and on the web, but I am still not able to resolve this problem.
Any help will be greatly appreciated.
Your's
Jens
I am totally confused.
On SmartGWT Pro 2.4 I have a server-side datasource containing a field:
Code:
<field name="birthday" type="date" dateFormatter="toShortDate" />
On my client I use the following code to display everything in german locale and timezone:
Code:
final TimeZoneConstants timeZoneConstants = GWT.create(TimeZoneConstants.class); final TimeZone TIMEZONE = TimeZone.createTimeZone(TimeZoneInfo.buildTimeZoneData(timeZoneConstants.europeBerlin())); DateUtil.setShortDateDisplayFormatter(new DateDisplayFormatter() { @Override public String format(final Date date) { if (date == null) { return null; } final DateTimeFormat dateFormatter = DateTimeFormat.getFormat("dd.MM.yyyy"); final String format = dateFormatter.format(date, TIMEZONE); return format; } });
This is converted to UTC when transferred to the client: April 10th 1978, 23:00:00 UTC which ist totally correct. But when debugging my date-formatter above I recognized that the date that is passed to it is April 10th 1978, 23:00:00 CET and therefore the date displayed is "10.04.1978".
What am I doing wrong? Is there a way to stop SmartGWT from setting the CET-timezone on the UTC-date on client-side?
I found a lot of related posts in the forum and on the web, but I am still not able to resolve this problem.
Any help will be greatly appreciated.
Your's
Jens
Comment