Hello, i'm trying to use the function Model.dateTime.toString("%B"), and it's working correctly in almost all months, except march. Is there another way to return the name of the month?
Hello, i'm trying to use the function Model.dateTime.toString("%B"), and it's working correctly in almost all months, except march. Is there another way to return the name of the month?
It could have something to do with your system being in Portuguese. March prints correctly for me in English. Maybe you could try using:
Model.dateTime.toString("%#x")
That prints out the long format of the date. If that works you could parse it out.
In portuguese, it still returning a shorthand value of month 3. I think its because "March" in portuguese is "Março". The "ç" probably is causing this inconsistence. But thanks for your answer.
You are right the problem is the "ç" character. This is a bug in the toString() method that we will get fixed.
In the meantime you can do something like this:
int month = Model.dateTime.month; string monthString; if (month == 3) { monthString = "março"; } else { monthString = Model.dateTime.toString("%B"); } return monthString;
7 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