How to add a date in MATH, Translation Configurator?

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf How to add a date in MATH, Translation Configurator?

  • Creator
    Topic
  • #47893
    Rentian Huang
    Participant

      Translation from vrl => vrl

      Function: ADD

      Source

      DateOfOrder

      =1

      Destination

      DfltDlDate

      This always adds 1 to the date, i.e. 20050710 => 20050711, but if the input is the end of month or year, it becomes: 20050131 => 20050132

      What should I use?

      Thanks in advance!

      Sam  8)

    Viewing 1 reply thread
    • Author
      Replies
      • #57004
        Charlie Bursell
        Participant

          You can’t do standard math on a date.  Standard math uses Base 10, 8, or 16.  Date math uses difefrent bases for month, day, tear, etc.

          Use the Date math function with the clock command.  for example:

          set dt 20050712

          set tomorrow [clock format [clock scan “$dt tomorrow”] -format %Y%m%d]

          echo $tomorrow  == 20050713

          Charlie

        • #57005
          Rentian Huang
          Participant

            It works like magic, thanks Charlie!

            I will put either a CALL or write a tcl to do it.

            Good day,

            Sam  ðŸ˜›

        Viewing 1 reply thread
        • The forum ‘Cloverleaf’ is closed to new topics and replies.