On Wed, 15 May 2002, Vinod Palan wrote:
> Do any one have date functions like that we have in asp 1) Dateadd()
> 2) Datediff()
> etc?

You might be able to get what you need with strtotime, which is a 
marvelous thing. See:


The rest of the time, I usually pass dates off to MySQL for math. You 
don't need to be doing any database transactions; you can just take 
advantage of its date functions by sending in constants:

  select date_add("2002-05-14 15:44:21", interval 1 day);

Write a function wrapper for the mysql_query() and mysql_result() and then
it's as easy to use as strtotime or anything else.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to