[ 
https://issues.apache.org/jira/browse/SLING-4258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14273471#comment-14273471
 ] 

Bertrand Delacretaz commented on SLING-4258:
--------------------------------------------

Thanks for your examples - I'm seeing different results with the current Sling 
trunk, in my case the output timezone is always the servers, see below. Which 
version of Sling (or of the o.a.s.servlets.post bundle) are you testing against?

{code}
$ export P=8888
$ export T=test1234
$ curl -F 'date1=2015-01-07T12:00:00.000+04:00' -F 'date1@TypeHint=Date' -F 
'date2=2015-01-07T12:42:00.000+0400' -F 'date2@TypeHint=Date' 
http://admin:admin@localhost:$P/tmp/$T ; curl 
http://admin:admin@localhost:$P/tmp/$T.tidy.json ; echo
...<html>
    <title>Content modified /tmp/test1234</title>
...
{
  "jcr:primaryType": "nt:unstructured",
  "date2": "Wed Jan 07 2015 09:42:00 GMT+0100",
  "date1": "Wed Jan 07 2015 09:00:00 GMT+0100"
  }
{code}


{code}

> Please document better how dates are handled by the Post servlet
> ----------------------------------------------------------------
>
>                 Key: SLING-4258
>                 URL: https://issues.apache.org/jira/browse/SLING-4258
>             Project: Sling
>          Issue Type: Improvement
>          Components: Documentation
>            Reporter: santiago garcía pimentel
>
> Im currently doing some things with dates in Sling that involve timezones and 
> I find that the documentation regarding it is not particularly clear.
> according to 
> https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html#date-properties
> several formats are defined. 
> I found that the only format that saves a provided timezone is the ISO8601 
> format, rest of them relies in a Date object, which does not have timezones. 
> Could this be clearly stated?
> Also, the ISO8601 parser is problematic. It relies on the Jackrabbit parser 
> which uses format "±YYYY-MM-DDThh:mm:ss.SSSTZD", but according to 
> http://www.w3.org/TR/NOTE-datetime the ISO format does not have milliseconds 
> on it ("SSS"). So it is very hard to find a way to keep the timezone 
> information (I had to dig through the code to figure it out)
> Could we please replace ISO8601 with the actual format 
> "±YYYY-MM-DDThh:mm:ss.SSSTZD" so it is clearer?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to