Subtract 5 hours from GMT

Anonymous
2013-03-09
2013-03-11
  • Anonymous - 2013-03-09

    Originally created by: 99bobster99

    Hello,

    I am a Codesys newbie. How do you subtract 5 hours from a DT variable? I searched Google, but could not find anything relating to this procedure.

     
  • Anonymous - 2013-03-09

    Originally created by: 99bobster99

    I think I figured it out. Please let me know if there is an easier way to do this. I converted my DT variable to a DWORD, then subtracted 18000 from it. This seems to work for me, but kind of ugly.

     
  • shooter - 2013-03-09

    make a var of same type like DT
    fill it with t#5h
    zonetime:DTIME:=t#5h;
    then simple subtract this.

    there is one drawback, when system overflows the time is not correct for 5 hours.

    see also w www.oscat.de w (it is english)

     
  • Anonymous - 2013-03-11

    Originally created by: 99bobster99

    Thank you Shooter, I will give that a try!

     

Log in to post a comment.