-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.Modelica.Utilities.System.getTime() returns bad year #3143
Comments
The call should be: So that you get day of the month as well. I don't know why Linux results are from last month :-) |
Yeah, I read the doc wrong. But still the issue with the month on Linux remains.
|
Hm, only for Win32 we increment the month
|
And the same for the year as well, which will be even more obvious. |
Yes, it was wrong from the beginning when I copied it from Modelica_Noise for MSL v3.2.2 |
I guess the problem with easily assigning to the bad value is due to not returning enumeration (or wrapping it into a record). |
Wrapping it into a record seems the most logical. Alternatively I think that the risk would have been less if we had used the same order as IS 8601 and reversed the output order to return year, month, ... (but changing it now would be too confusing). |
Could we change it to a record for 4.x? |
I think there might be a possibility to rename getTime() to Internal.getTime() or something with the same interface. And then create a new getTime() that works by calling that function and creating a record on top of it. |
This is addressed by #3247. |
Running this model:
with OpenModelica on Windows will give you
year=10
and on Linux will give youyear=9
.With Dymola 2019 on Windows ill give you
year=10
.The code for the external C is here:
https://github.com/modelica/ModelicaStandardLibrary/blob/master/Modelica/Resources/C-Sources/ModelicaInternal.c#L1264
I haven't looked in detail into it, maybe somebody can spot the problem.
The text was updated successfully, but these errors were encountered: