On Monday 18 July 2005 10:09 am, Eko Budiharto wrote:
> Hi list,
> I have question. I got a piece of date data from mysql.
> Just saying, the data is 2005-06-05 00:00:00
> and then I would like to add it by 30 days
> it is supposed to be like this
> my $oldDate = "2005-06-05 00:00:00";
> my $newDate = $oldDate + 86400 * 30;
>
> but I confuse why it is not working. please help...
Might be easier to simply let MySQL do the work for
you, e.g.,
mysql> select from_days(to_days('2005-06-05 00:00:00')+30);
+----------------------------------------------+
| from_days(to_days('2005-06-05 00:00:00')+30) |
+----------------------------------------------+
| 2005-07-05 |
+----------------------------------------------+
1 row in set (0.00 sec)
Scott
--
POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/
Linux 2.6.11.4-21.7-default x86_64
SuSE Linux 9.3 (x86-64)
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs