Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84563members
353832posts

Date Time Picker

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

Solved
DavidSkilbeck
Lt. Commander
Lt. Commander
0 Likes
4
1485

Date Time Picker

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,


Accepted Solutions
tfranklin
Lt. Commander
Lt. Commander
0 Likes
2
1457

Re: Date Time Picker

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

See Answer In Context

4 Replies 4
geoffpatton
Commander
Commander
0 Likes
0
1472

Re: Date Time Picker

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.

tfranklin
Lt. Commander
Lt. Commander
0 Likes
2
1458

Re: Date Time Picker

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

DavidSkilbeck
Lt. Commander
Lt. Commander
0 Likes
1
1440

Re: Date Time Picker

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,

BevanWeiss
Spock
Spock
0 Likes
0
1385

Re: Date Time Picker

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...


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..