Is there any way in flexsim to get current UTC timestamp in the format of DD/MM/YYYY HH:MM:SS timeformat?
Is there any way in flexsim to get current UTC timestamp in the format of DD/MM/YYYY HH:MM:SS timeformat?
Hi @Preet, was one of Jason Lightfoot's or Ben Wilson's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. 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.
Here's a realtime conversion script:
string yearstring=realtime(12); yearstring=yearstring.substr(yearstring.length-4,4); string timestring=realtime(10); string datestring=realtime(11); datestring=datestring.substr(1,datestring.length-2)+yearstring; DateTime now=DateTime(datestring+" "+timestring,"%m/%d/%Y %T"); string offset=now.toString("%z"); int hrOffset=offset.substr(2,2).toNum(); int minOffset=offset.substr(4,2).toNum(); int sign=offset.substr(1,1)=="-"?-1:1; DateTime diff=DateTime(3600*hrOffset+60*minOffset); now=now-sign*diff; return now.toString();
You might try the realtime() command.
realtime() returns the real clock time in a variety of formats based on the input parameter.
https://docs.flexsim.com/Reference/CodingInFlexSim/CommandReference/Commands.html#realtime
15 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved