EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-11-11 01:51 AM . Last Modified: 2023-05-03 12:07 AM
Hi,
do we have access to a date / time picker from the mimic or via vbscript?
Does a time point have to be used.
I need a way for the operator to select a date (no time) and then I need to put that date into a string with no "/" in it.
Into this format 20200830 for example.
Thanks,
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-11-11 01:30 PM . Last Modified: 2020-11-11 01:36 PM
There's a form function for Form.AddDateTime that'll do what you want. You can pull the value from a user input then format it in script however you want.
i think the syntax would be something like
set startDT = form.adddatetime(1,1)
then once the user hits OK you can use startDT.value as the variable you format
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-11-11 06:18 AM
Only thing I know is you can use a Variable Time object and give the user access to the set value method. It has a time also but they can just know to ignore that. You can then take that value and edit the string to just be the numbers for month day and year.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-11-11 01:30 PM . Last Modified: 2020-11-11 01:36 PM
There's a form function for Form.AddDateTime that'll do what you want. You can pull the value from a user input then format it in script however you want.
i think the syntax would be something like
set startDT = form.adddatetime(1,1)
then once the user hits OK you can use startDT.value as the variable you format
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-11-11 06:06 PM . Last Modified: 2020-11-11 08:39 PM
Hi,
It does work.
However, I cant find anything that changes the format neatly.
I can do it via code below. But its crude.
StartDate.Value = CSTR(DateAdd("d",-14,now))
StartDate.Value = Left(StartDate.Value, 10)
StartDateValue = (Replace(StartDate.Value,"/",""))
year = Right(StartDateValue, 4)
MsgBox year
month = Mid(StartDateValue,3,2)
MsgBox month
day = Left(StartDate, 2)
MsgBox day
StartDateValue = year + month + day
MsgBox StartDateValue
Thanks,
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-11-19 04:40 AM
Once you have the DateTime value, you should be able to use VBscript stuff to format it a little
https://www.w3schools.com/asp/func_formatdatetime.asp
I'm pretty sure I've used this before...
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.