openhab/openhab — pull request #960 by boecko (2014-04-02 07:30:32+00:00)
Title: DateTimeType with timezone detection

Hi,

this patch enables correct reading in different-timezones (eg. in XML from weatherforcast), it falls back to the old parsing without timezone.
Example:
OpenWeather-XML
```xml

```
This times are in UTC (timezone is omitted)
The item would be converted to the the wrong time:
```
DateTime ow_sunrise "Sonnenaufgang [%1$tR]" (Wetter) { http="<[openWeatherCache:1440000:XSLT(openweather_sunrise.xsl)]" }
```
see
```groovy
groovy:000> import java.text.SimpleDateFormat;
===> [import java.text.SimpleDateFormat;]
groovy:000> DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
===> java.text.SimpleDateFormat@6b2ed43a
groovy:000> sunrise = '2014-03-30T04:58:47'
===> 2014-03-30T04:58:47
groovy:000> DATE_FORMATTER.parse
parse( parseObject(
groovy:000> DATE_FORMATTER.parse(sunrise)
===> Sun Mar 30 04:58:47 CEST 2014
```
The Correct timestamp would be _Sun Mar 30 06:58:47 CEST 2014_

Via transform, i'm attaching the timezone:
```XSL

```
now the time is correct:
```groovy
groovy:000> DATE_FORMATTER_WITH_TZ = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz");
===> java.text.SimpleDateFormat@faabb380
groovy:000> sunrise = '2014-03-30T04:58:47' + 'UTC'
===> 2014-03-30T04:58:47UTC
groovy:000> DATE_FORMATTER_WITH_TZ.parse(sunrise)
===> Sun Mar 30 06:58:47 CEST 2014
```