issue-#154 Atomic operation to get date and time

Merged to the master branch

issue-#154 Atomic operation to get date and time

Postby Ivan Denisov » Mon Mar 13, 2017 4:25 pm

Ilya Ermakov found a critical issue: https://forum.oberoncore.ru/viewtopic.p ... 24#p100624

Module Dates has GetDate and GetTime procedures. However it does not have GetDateTime procedure.
There is the risk that at the boundary of the day application will get previous day but the time will be 00:00:00 except of 23:59:59. So there will be one day back.

To prevent such case in applications with critical safety there should be atomic operation for getting date and time.

There is the hook GetTime (OUT d: Date; OUT t: Time) for this operation, so realization of this issue is trivial:
https://redmine.blackboxframework.org/p ... 09ddc6ad20

BlackBox for testing new procedure Dates.GetDateTime:
http://blackboxframework.org/unstable/i ... a1.804.zip
Ivan Denisov
 
Posts: 1694
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#154 Atomic operation to get date and time

Postby Robert » Mon Mar 13, 2017 9:01 pm

Looks good to me.
User avatar
Robert
 
Posts: 987
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#154 Atomic operation to get date and time

Postby Josef Templ » Tue Mar 14, 2017 12:53 pm

Looks good to me, too.

I would suggest to add the same also for UTC: "GetUTCDateTime".

For logging purposes, for example in the Http server, I have to use UTC
time because this is required for the log file format standard.
I think this is exactly what the issue is intended for.

- Josef
User avatar
Josef Templ
 
Posts: 2002
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#154 Atomic operation to get date and time

Postby Ivan Denisov » Tue Mar 14, 2017 1:44 pm

Ivan Denisov
 
Posts: 1694
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#154 Atomic operation to get date and time

Postby Josef Templ » Tue Mar 14, 2017 2:23 pm

Thanks, for me this is ready for voting.

- Josef
User avatar
Josef Templ
 
Posts: 2002
Joined: Tue Sep 17, 2013 6:50 am


Return to Resolved (Features)

Who is online

Users browsing this forum: No registered users and 0 guests