Logic Timer Format

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by muppets, Nov 12, 2007.

  1. muppets

    muppets

    Joined:
    Oct 26, 2007
    Messages:
    98
    Likes Received:
    0
    Can anyone please tell me what the syntax format of the logic timer is? The only info I could find is that the max time is 32767 seconds (9hrs) though many examples of code display the timertime = as "xx:yy:zz" which I presume is x for hours, y for mins and z for seconds.

    Does this mean timertime = statements can be written in either total seconds or as written above?

    I have searched all the help with piced/logic and couldn't find the correct syntax.

    The reason I need this is so that an i/o can be created from 3 strings ie
    05 (hrs), 31 (mins), 12 (secs) = "05:31:12"
     
    muppets, Nov 12, 2007
    #1
  2. muppets

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    See the logic help file topic "Time Functions". It says :
    Tags can be used for the time, instead of using a number. The interpretation of the time tags depends upon the time format selected in the Windows Control Panel.

    yes

    It was cleverly hidden in a topic about "time" ;)

    Note that tags are not the same as strings. See the logic help topic "tags".

    What is it exactly that you need to do ?
     
    Darren, Nov 15, 2007
    #2
  3. muppets

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    I have just read another of your posts, so I think I know what you want now.

    If you need to convert three variables containing the time in hours, minutes and seconds into a value which can be used as a time (seconds), the equation is :

    time = hours * 3600 + minutes * 60 + seconds
     
    Darren, Nov 15, 2007
    #3
  4. muppets

    Lucky555

    Joined:
    Aug 13, 2007
    Messages:
    229
    Likes Received:
    0
    In future it would be helpful if you didn't hide help info in obscure locations. :p ;)
     
    Lucky555, Nov 15, 2007
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.