You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "M Carissimi (JIRA)" <ji...@apache.org> on 2015/05/11 18:45:00 UTC

[jira] [Updated] (OLINGO-657) Milliseconds in DateTime data type

     [ https://issues.apache.org/jira/browse/OLINGO-657?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

M Carissimi updated OLINGO-657:
-------------------------------
    Description: 
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?


  was:
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?



> 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
>
> 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)