This something is called "unix timestamp", and is the number of seconds since start of the epoch (whatever that means, I always forget that...)
I'd suggest you use a module that parses the date, like Date::Parse or Date::Manip. Search on cpan for date will give you quite a list of modules. | [reply] |
I think Date::Parse can help you out. Its main function is parsing human-readable dates into more machine-oriented formats. | [reply] |
And, though this may already be obvious to you, you'll have to make sure the date entered by the user is in some recognizable format...
yyyy-mm-dd, mm/dd/yy, dd/mm/yy and so on are just a few of the variants which are widely used.
So... you need to constrain the user's input. Guessing (perhaps utterly wrongly, but the principal applies generally) that the user entered date may be coming from a form on the web, make sure your form requires a format which one of the suggestions above can recognize. | [reply] |