Page last modified 12:16, 29 May 2018 by villes

.minusHours() / .minusMinutes() / .minusSeconds()

    Table of contents

    Description of the method

     

    Description: .minus{Hours|Minutes|Seconds}() method reduces as many of hours or minutes or seconds as the integer in the parameter indicates.
    Available for: ISO Date Time
    Parameters: integer
    Return type: ISO Date Time

     

    Example

    Context: HeaderType1 
    OCL: self.TimeStamp.minusHours(2) = self.Dt
    Description: The example rule compares the date & time of <TimeStamp> minus 2 hours to the date & time of <Dt>. If the date & time of <TimeStamp> after the reduced hours equals the date & time of <Dt>, true will be returned. This works in the same way with minutes and seconds.

     

    The XML snippet below would pass this check.

    <Header>
        <Dt>2018-05-28T10:17:50</Dt>
        <TimeStamp>2018-05-28T12:17:50</TimeStamp>
    </Header>

    The other snippet below however would not pass this check.

    <Header>
        <Dt>2018-05-28T08:17:50</Dt>
        <TimeStamp>2018-05-28T12:17:50</TimeStamp>
    </Header>

    Menu