It's clear now, what you did need.
Paul gave you a correct solution.
As for the GT::Date module, I aggree, it would be fine to be able to do second, hour, month, year based operations, too, in addition to currently available day operations. Currently a possible workaround is, to convert a date to unix time, do operations, and convert back.
Following functions could be implemented:
- date_add_second, date_add_hour, date_add_month, date_add_year
- date_sub_second, date_sub_hour, date_sub_month, date_sub_year
- date_diff_second, date_diff_hour, date_diff_month, date_diff_year (e.g. result of date_diff_month will be a rounded month number)
Would not be too difficult to have these functions implemented.
Example for date_sub_hour function:
E.g.: $date = date_sub_hour ("2003-01-23 01:05:01 +0100", 3 ); # This would subtract 3 hour from date, and would result "2003-01-22 22:05:01 +0100".
Ok. These were my suggestions.
I also have a question, related to GMT dates. It's not clear how is possible to treat GMT based dates, using GT::Date functions. The docs unfortunately does not give examples about this.
I know & use several functions of GT::Date, but there are some undocumented features, and some are not documented well enough. I spent a few hours today to check how the features in GT::Date works, but GMT dates are not clear, yet.
Anybody has experience with GT::Date, in particular with GMT date usage?
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...