in reply to date time to unix
Wow. Your indenting is all over the place. Not to mention that the comment on the get_date sub is inaccurate and therefore misleading. But minor quibbles aside, I'd suggest using <code> tags to enclose code blocks. Your code looks odd because of things that appear to be $_0 which isn't valid. It looks like you meant $_[0], though. Oh, and @_[0] should probably be $_[0] anyway.
Anyway, that's all extraneous info. I ran your script snipppet through perl with the -wc switch. There was a warning about $hours in the date_to_unix sub. Your split is also not working properly.
I added the line die "Mon: $mon\nDay: $day\nYear: $year\nHour: $hour\nMin: $min\nSec: $sec\n"; after the split and got the following output when calling date_to_unix with the string "09/23/2003 14:30":
Mon: 09 Day: 23 Year: 2003 14:30 Hour: 09/23/2003 14 Min: 30 Sec:
So there's some direction, but no discrete answers. I leave it as an exercise to the reader to fill in the holes.
Update: The comment about using code tags has been taken care of. So that part of my note is obviously not relevant any more. :)
|
|---|