Re: TO_DAYS() equivalent?
| From: | Hugh Bothwell | Date: | Fri, 29 Jun 2001 23:16:05 +0000 |
| Subject: | Re: TO_DAYS() equivalent? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-9981@lists.php.net to get a copy of this message | ||
How about this?
define("SECONDS_PER_DAY", 86400);
$now = (int) (time() / SECONDS_PER_DAY);
Note that this may not match the time you get from your database server,
depending on what time zones you're in.
""David W. Banks"" <dwbanks@napanet.net> wrote in message
news:3B3B7A7B.438A8B80@napanet.net...
> Is there some way to get the equivalent of "select TO_DAYS(NOW())"
> out of PHP without querying MySQL (or whatever.) Some formatting character
> for the date() function that I'm just missing?
>
> Thanks,
> -Dave
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>