We use the DD-MM-YYYY HH:mm:ss
date and time format API between frontend and backend.
However, there are cases that backend gets only the date since time wasn’t selected at the frontend side.
The GET
call parameter will look like this:
startTime=16-11-2021
At the backend side, we use the COleDateTime
class in order to parse the date and time. The problem is that the time in the case above is initialized to 00:00:00
when actually no time is sent. I need a way to distinguish between no time sent and midnight as the actual time is significant in our system and there is a big difference between no time sent and midnight.
It seems that the ParseDateTime
function expects to get a flag in its second parameter VAR_TIMEVALUEONLY
to Ignore the date portion during parsing.
So for that, I need to implement a parse function in order to know if I got the time or not where it is expected that the ParseDateTime
function would be set as an undefined time like -1
when no time is sent.
Is there a way to distinguish between no time to midnight in COleDateTime
class? If not, maybe you have another way I can use public libraries like <chrono>
which could solve my problem?