View Issue Details

IDProjectCategoryView StatusLast Update
0001860COM-HDA Sample Codepublic2012-01-31 09:58
ReporterMoazzam Ahmad Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Summary0001860: OpcHdaResolveTime output wildly incorrect for certain inputs
Description

Copy/pasted from following forum post:
http://www.opcfoundation.org/forum/viewtopic.php?p=16637

Briefly, I feel there are at least TWO bugs in OpcHdaResolveTime:

  1. The OPC HDA 1.20 Specification document (section 5.3.4) specifies the following expected outcomes for some sample inputs:
    a. 10-Jan-2001 + 1 MO = 10-Feb-2001
    b. 29-Jan-1999 + 1 MO = 28-Feb-1999
    c. 31-Mar-2002 + 2 MO = 30-May-2002
    d. 29-Feb-2000 + 1 Y = 28-Feb-2001
    If I set my system's date/time to test case (c), the output from OpcHdaResolveTime is "31-May-2002", instead of the expected output of "30-May-2002"!
    Is the spec incorrect or is the implementation displaying a bug?

  2. The second issue is even more severe. Set the system's date/time to, say, 15-Jan-2012.
    a. Pass "NOW-15D" and we get "31-Dec-2011" as expected.
    b. Now try "NOW-16D" and the output becomes "3-Dec-1617"!
    c. Similar problems exist with input like "NOW-3W" and possibly others as well.

Additional Information

It seems that a relative time format specially crafted to resolve into some date of the PREVIOUS year causes the logic to misbehave, at least in the case of the "NOW-XD" convention as well as the "NOW-XW" convention.

The severity would be low if the actual output was reasonably close to the expected output, but severity is potentially high because the actual output often becomes significantly divergent (by many CENTURIES!) from the expected output.

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2012-01-31 09:58 Moazzam Ahmad New Issue