Welcome to the new Schneider Electric Community

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

Close
Important Announcement: WELCOME to the new Schneider Electric Community! Community is now no longer part of Exchange, and is now rebranded under se.com. If you have any bookmarks and links saved, we request you to update them to ensure that you continue accessing our community from this new location. For any issues that you might encounter as part of this change, please reach out to SchneiderCommunity.Support@se.com, and the team will help to get your issues resolved.
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
82538members
350144posts

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
1416

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
1388

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
1403

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
1389

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
1371

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
1316

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