Check a (PV1-44) date is less then a current date ?

Homepage Clovertech Forums Read Only Archives Cloverleaf Tcl Library Check a (PV1-44) date is less then a current date ?

  • Creator
  • #51382
    Ganesan Murali

    In TCL

    how to check a PV1-44 admit date  is less then a current date ?

    If the Pv1-44 is less then current date no need to change the Pv1-44.

    If the Pv1-44 is greater then current date need to change the Pv1-44 as blank.

    How do we achieve this in tcl ?


Viewing 4 reply threads
  • Author
    • #70010

      Ganesan, you can use the tcl clock command. Let me know if you’d like some examples.

      -- Max Drown (Infor)

    • #70011
      Ganesan Murali

      Can you pls give me some samples ? Tks.

    • #70012
      Russ Ross

      I use our callable generic proc ( oth_chk_time_span.tcl ) for things like this.

      It is posted at this URL

      <a href="; class=”bbcode_url”>

      Also, a search of clovertech will likely yield many useful examples as I recall posts about this topic over the years.

      Russ Ross

    • #70013

      Here’s a quick example of the basic idea. You’ll need to modify it for your own needs. And defintely check out the thread Russ mentioned. Clock scan takes a bit of time to get your mind around.


      set tmp [clock format [clock scan “[string range [lindex $xlateInVals 0] 0 7] [string range [lindex $xlateInVals 0] 8 13]”] -format “%m/%d/%Y %H:%M:%S”]; set xlateOutVals [list $tmp]

      -- Max Drown (Infor)

    • #70014
      David Barr

      There are at least two options.  You can use “clock scan” to convert the PV1 44 time to seconds and compare that to the current time in seconds, which is returned by “clock seconds”.  It might be slightly simpler to use “clock format” to convert the current time to the same format at PV1 44 and compare the fields.


      if { “s$pv144” < [clock format [clock seconds] -format "s%Y%m%d%H%M%S"] } {

      I added an “s” character to each side of the test to make sure that I was doing a string comparison instead of a numeric comparison, because these numbers are big enough to overflow integer variables.  Maybe not necessary.

Viewing 4 reply threads
  • The forum ‘Tcl Library’ is closed to new topics and replies.

Forum Statistics

Registered Users
Topic Tags