I am planning to write a module in C under Linux environment to read time from user defined date and time string. The user may enter time as shown below ( not limited to ). He may skip date and enter only time as well.
DD/MM/YY HH-MI-SS
DD/MM/YYYY HH/MI/SS
YYYY-MM-DD-HH-MI-SS-MSC
YYYY-DDD-HH-MI-SS
HH-MI-SS
HH/MI/SS
.......
How to offer such a facility to the user ? The user should have the flexibility to choose his expression. The module should have the ability to extract the Date and time details from that expression. In the 1st step , he should define his expression. In the second step , he should enter time as per his expression.