Announcement

Collapse
No announcement yet.

DateTime values and conversion between VDs and GVs?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DateTime values and conversion between VDs and GVs?

    So I was hacking some things on my HS3 (Linux), and one of the items on today's agenda is to move a DateTime value from a VD (Virtual Device) DeviceString property to/from a GV (Global Variable) DateTime. Now the funny thing is, when I run some code like:
    Code:
    &hs.setDeviceString(592,FormatDateTime(cstr(hs.GetVar("gv_tod_vacation_from"))),False)
    Well if the GV has a value of "01/08/2018 00:00:01" it will be transformed to only date "01/08/2018".
    Now if the GV has a value of "01/08/2018 01:00:00" it will be fully moved over so it still is "01/08/2018 01:00:00".

    So then I decided to test:
    Code:
    &hs.setDeviceString(592,DateTime.parse(FormatDateTime(cstr(hs.GetVar("gv_tod_vacation_from")))),False)
    No difference.

    Any idea where I turn wrong here? Why is a DateTime value with 00:00:01 lost in the translation so to speak? Anything I need to know kind of?
Working...
X