I have an input which may contain a date, or time, or both. In case the date is provided I can use that date but in case the date is not provided (i.e. only the time is provided) then I have to use a different date provided from someplace else.
But once I parse the date using using python dateutil, today's date is added to the parsed value. For example:
from dateutil.parser import parse
print(parse('03:15:08'))
print(parse('04-04-2019 03:15:08'))
the above code gives the following output:
2019-04-04 03:15:08
2019-04-04 03:15:08
As you can see the information (that the date was provided or not) is lost and can't be differentiated.
Also some kind of length manipulation may not work because only the date may be provided.
How to differentiate between the 2 inputs?
Thank you.