question

yexioamu avatar image
0 Likes"
yexioamu asked Jeanette F commented

How can i get the windows system time?

How can i get the windows system time?

FlexSim 21.2.4
time
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @yexioamu, was Przemyslaw Pasich's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

Przemyslaw Pasich avatar image
0 Likes"
Przemyslaw Pasich answered Przemyslaw Pasich commented

Try:

DateTime now = DateTime(realtime(11) + " " + realtime(10), "%m/%d/%y %H:%M:%S");
return now.toString();
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

yexioamu avatar image yexioamu commented ·

wow, it's effective, thank you!

does the function realtime(2) means get the milliseconds?


0 Likes 0 ·
Przemyslaw Pasich avatar image Przemyslaw Pasich yexioamu commented ·

Corrrect; according to the documentation:

"2 = the number of milliseconds since the last second change"

0 Likes 0 ·