[
https://issues.apache.org/jira/browse/OLINGO-657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14539630#comment-14539630
]
M Carissimi commented on OLINGO-657:
------------------------------------
Hello Michael
thank you for your reply. I was not aware of the utility methods provided by
the EdmSimpleType class to covert string literals into Java objects. Using this
class I can correctly convert the String {{2015-05-11T12:15:10.14}} to a
Calendar/Date object with the correct value of milliseconds (140).
Do you have any documentation other than Java Doc that describes the existence
and usage of classes similar to EdmSimpleType?
Cheers
M
> Milliseconds in DateTime data type
> ----------------------------------
>
> Key: OLINGO-657
> URL: https://issues.apache.org/jira/browse/OLINGO-657
> Project: Olingo
> Issue Type: Question
> Components: odata2-core
> Affects Versions: V2 2.0.3
> Reporter: M Carissimi
> Assignee: Michael Bolz
>
> Hello,
> we need to represent DateTime properties with milliseconds. I understand that
> OData V2 supports the use of this using the format
> datetime’yyyy-mm-ddThh:mm[:ss[.fffffff]]’.
> In our code, a start date time of 11/May/2015 12:15:10.140 (i.e. with
> milliseconds value of 140) is rendered as
> {code}
> <d:START_DATETIME
> m:type="Edm.DateTime">2015-05-11T12:15:10.14</d:START_DATETIME>
> {code}
> When we receive a request for an entry with key parameter
> START_DATETIME=datetime'2015-05-11T12:15:10.14', this is incorrectly parsed
> in Java because the format {{yyyy-MM-dd'T'hh:mm:ss.SSS}} returns the value
> *014* instead of *140* for milliseconds.
> Is there a way to ensure our entries use 3 digits for milliseconds so that we
> get:
> {code}<d:START_DATETIME
> m:type="Edm.DateTime">2015-05-11T12:15:10.14</d:START_DATETIME>
> {code}
> Alternatively, does Olingo provide utility classes to convert a datetime()
> String entry into a Java Date or Calendar?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)