2019-09-05 01:23:14 I got a string like before, I am wondering how to convert to DateTime format and then retrieve Year(2019) and minute(23) directly? Is it possible? Thank you .
2019-09-05 01:23:14 I got a string like before, I am wondering how to convert to DateTime format and then retrieve Year(2019) and minute(23) directly? Is it possible? Thank you .
The ability to parse DateTime strings with the DateTime class will be available in FlexSim 20.0
@BJ C @Kyle Y
This is not the correct answer because there is function called "convert" which can convert a string into a datetime. Only issue is that it expects the time before the data (so 01:23:14 2019-09-05) but with the string class this is not very complex.
Thank you Steven. I have tried with the following code as you mention, but seems there are still something wrong. IIt's supposed to return 2019. But FlexSim return only 1999. Could you please help to have a look? Thank you.
string dateString="00:59:23 2019-09-05"; double dateNum = convert(dateString, DATE_STR, FS_DATETIME); DateTime dateObject = DateTime(dateNum); return dateObject.year;
Thank you Steven. Seems the Datetime_str should in this format: "8:00:00 AM Fri 26 Aug 2016"? Am I correct?
14 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