So I have this line of code:
That works just great, however I get an US date in return, and I would like to get it into Swedish, some googling suggested something like:
And then HS3 reboots everytime I trigger this. Someone might be able to tell me what I am doing wrong here?
Purpose: Update a device with the datepart (into YYYY-MM-DD) from a global variable (which keeps a DateTime value with US standard, ex. "26/12/2019 23:59:59" - so I would like "2019-12-26" (don't need the time at all - it is just for display on ImperHome screen for status kind of thing)). In this case the global variable holds the date from when I am on vacation and yes I have another one for when the vacation ends.
So anyone has any great oneline code for this, or do I need to go to a full script file for this?
Code:
&hs.setDeviceString(592,DateTime.parse(FormatDateTime(cstr(hs.GetVar("gv_tod_vacation_from")))),False)
Code:
&hs.setDeviceString(592,DateTime.parse(FormatDateTime(cstr(hs.GetVar("gv_tod_vacation_from")))),System.Globalization.CultureInfo.GetCultureInfo("sv-SE"))
Purpose: Update a device with the datepart (into YYYY-MM-DD) from a global variable (which keeps a DateTime value with US standard, ex. "26/12/2019 23:59:59" - so I would like "2019-12-26" (don't need the time at all - it is just for display on ImperHome screen for status kind of thing)). In this case the global variable holds the date from when I am on vacation and yes I have another one for when the vacation ends.
So anyone has any great oneline code for this, or do I need to go to a full script file for this?
Comment