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,
Solved! Go to Solution.
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
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.
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
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,
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...
Discuss challenges in energy and automation with 30,000+ experts and peers.
Find answers in 10,000+ support articles to help solve your product and business challenges.
Find peer based solutions to your questions. Provide answers for fellow community members!