You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Adrian Crum (JIRA)" <ji...@apache.org> on 2009/07/22 17:59:14 UTC

[jira] Closed: (OFBIZ-2748) Wrong calculation in UtilDateTime getIntervalInDays

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

Adrian Crum closed OFBIZ-2748.
------------------------------

    Resolution: Won't Fix

Anne,

It would be preferable to use the TimeDuration class instead of these UtilDateTime methods.

The UtilDateTime methods are flawed because they don't take locale and time zone into consideration, and they use millisecond arithmetic (a definite no-no). Those methods are about to be deprecated and eventually they will be removed.


> Wrong calculation in UtilDateTime getIntervalInDays
> ---------------------------------------------------
>
>                 Key: OFBIZ-2748
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2748
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 9.04
>         Environment: Sun Java 6, Linux, Postgres 
>            Reporter: Anne Jessel
>         Attachments: castbug.patch
>
>
> If the two timestamps passed to getIntervalInDays are more than Integer.MAX_VALUE nanoseconds apart, the returned value is incorrect.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: Query re: (OFBIZ-2748) Wrong calculation in UtilDateTime getIntervalInDays

Posted by Adrian Crum <ad...@hlmksw.com>.
That is correct.

-Adrian

anne@cohsoft.com.au wrote:
> Thank you. Wish I'd known a week ago. :-)
> 
> Could someone please clarify - the methods in UtilDateTime destined for 
> deprecation are those not using TimeZone or Locale? So those using 
> TimeZone and Locale are okay to use?
> 
> Cheers,
> Anne.
> 
> 2009/7/23 Adrian Crum (JIRA) <ji...@apache.org>
> 
> 
>         [
>     https://issues.apache.org/jira/browse/OFBIZ-2748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
>     <https://issues.apache.org/jira/browse/OFBIZ-2748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel>
>     ]
> 
>     Adrian Crum closed OFBIZ-2748.
>     ------------------------------
> 
>        Resolution: Won't Fix
> 
>     Anne,
> 
>     It would be preferable to use the TimeDuration class instead of
>     these UtilDateTime methods.
> 
>     The UtilDateTime methods are flawed because they don't take locale
>     and time zone into consideration, and they use millisecond
>     arithmetic (a definite no-no). Those methods are about to be
>     deprecated and eventually they will be removed.
> 
> 
>      > Wrong calculation in UtilDateTime getIntervalInDays
>      > ---------------------------------------------------
>      >
>      >                 Key: OFBIZ-2748
>      >                 URL:
>     https://issues.apache.org/jira/browse/OFBIZ-2748
>     <https://issues.apache.org/jira/browse/OFBIZ-2748>
>      >             Project: OFBiz
>      >          Issue Type: Bug
>      >          Components: framework
>      >    Affects Versions: Release Branch 9.04
>      >         Environment: Sun Java 6, Linux, Postgres
>      >            Reporter: Anne Jessel
>      >         Attachments: castbug.patch
>      >
>      >
>      > If the two timestamps passed to getIntervalInDays are more than
>     Integer.MAX_VALUE nanoseconds apart, the returned value is incorrect.
> 
>     --
>     This message is automatically generated by JIRA.
>     -
>     You can reply to this email to add a comment to the issue online.
> 
> 
> 
> 
> -- 
> Coherent Software Australia Pty Ltd
> PO Box 2773
> Cheltenham Vic 3192
> Phone: (03) 9585 6788
> Fax: (03) 9585 1086
> Web: http://www.cohsoft.com.au/
> Email: sales@cohsoft.com.au
> 
> Bonsai ERP, the all-inclusive ERP system
> http://www.bonsaierp.com.au/
> 

Query re: (OFBIZ-2748) Wrong calculation in UtilDateTime getIntervalInDays

Posted by an...@cohsoft.com.au.
Thank you. Wish I'd known a week ago. :-)

Could someone please clarify - the methods in UtilDateTime destined for deprecation are those not using TimeZone or Locale? So those using TimeZone and Locale are okay to use?

Cheers,
Anne.

2009/7/23 Adrian Crum (JIRA) &lt;jira@apache.org&gt;

 &nbsp; &nbsp; [ https://issues.apache.org/jira/browse/OFBIZ-2748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Crum closed OFBIZ-2748.
------------------------------

 &nbsp; &nbsp;Resolution: Won't Fix

Anne,

It would be preferable to use the TimeDuration class instead of these UtilDateTime methods.

The UtilDateTime methods are flawed because they don't take locale and time zone into consideration, and they use millisecond arithmetic (a definite no-no). Those methods are about to be deprecated and eventually they will be removed.


&gt; Wrong calculation in UtilDateTime getIntervalInDays
&gt; ---------------------------------------------------
&gt;
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Key: OFBIZ-2748
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; URL: https://issues.apache.org/jira/browse/OFBIZ-2748
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Project: OFBiz
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Issue Type: Bug
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Components: framework
&gt; &nbsp; &nbsp;Affects Versions: Release Branch 9.04
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Environment: Sun Java 6, Linux, Postgres
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Reporter: Anne Jessel
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Attachments: castbug.patch
&gt;
&gt;
&gt; If the two timestamps passed to getIntervalInDays are more than Integer.MAX_VALUE nanoseconds apart, the returned value is incorrect.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



-- 
Coherent Software Australia Pty Ltd
PO Box 2773
Cheltenham Vic 3192
Phone: (03) 9585 6788
Fax: (03) 9585 1086
Web: http://www.cohsoft.com.au/
Email: sales@cohsoft.com.au

Bonsai ERP, the all-inclusive ERP system
http://www.bonsaierp.com.au/