Originally posted by ZeroGravitas
View Post
Announcement
Collapse
No announcement yet.
Simple date formatting for Device Last Change
Collapse
X
-
-
Originally posted by ZeroGravitas View PostWoohoo! I can script! (Sort of.)
Thank you so much Mike, it does exactly what I was looking for.
I did have to make one change. When I first ran the script, it came back with a weird output date; based on all the reading & googling I had done up till now, I figured pretty quickly that changing "DeviceLastChange" to "DeviceLastChangeRef" was needed, and it worked exactly as expected.
Leave a comment:
-
Woohoo! I can script! (Sort of.)
Thank you so much Mike, it does exactly what I was looking for.
I did have to make one change. When I first ran the script, it came back with a weird output date; based on all the reading & googling I had done up till now, I figured pretty quickly that changing "DeviceLastChange" to "DeviceLastChangeRef" was needed, and it worked exactly as expected.
(In case anyone was wondering, I am working to output last change dates to HSTouch through virtual devices into which I am putting these dates, with the twist that if it is "Today" I have the output as Today (in a separate virtual device). When it rolls over into tomorrow, I needed to go back and get the last change date and output that in the correct date format. In the end I think it makes perfect sense as a two-step process.)
Leave a comment:
-
You could do it with a two-line vb.net script:
Code:Sub Main(ByVal Params As Object) Dim dteLast As Date = hs.DeviceLastChange(70) hs.SetDeviceString(62, dteLast.ToString("ddd d MMM h:mm tt"), True) End Sub
Leave a comment:
-
Simple date formatting for Device Last Change
Hi all:
I don't know much about scripting at all however have gotten a couple of immediate script commands to work, namely:
&nhs.setdevicestring(62, NOW.ToString("ddd d MMM h:mm tt"), true)
&nhs.setdevicestring(62, hs.DeviceLastChangeRef(70),true)
I would like to format the date that comes from the second script to be just like the first. I've tried a number of different variations and can't get anything to work.
I'm sure it's a simple answer but I would really appreciate it if someone has a quick and ready answer.....
Thanks in advance.Tags: None
Leave a comment: