Link to home
Start Free TrialLog in
Avatar of akohan
akohan

asked on

passing timing parameters

Hello group,

In part of my code, I have to call a function which in there I should pass parametrs like       Year, month, day and hour. So, basically, user will call the exectuable file like:

     $ ./prog  2008 11  3  0  

which in fact is year 2008, month = Nov, first day of month and hour = 0 a.m.  or TODAY!
note that 0 = 12 a.m.

so now in order to make it more user-friendly I'm thinking of passing some pre-defined tokens like

    $ ./prog  today  
    $ ./prog  yesterday
    or  
    $ ./prog week
 
Question:
1) Is it ok to create a CASE block for these tokens?
2) how should I handle today or TODAY or tOdAY ?

Regards.
SOLUTION
Avatar of sunnycoder
sunnycoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of akohan
akohan

ASKER


Everybody has come up with nice solution and also links.

Thanks!