For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > January 2005 > RE: [PHP-DB] Pulling Date from MySQL then subtract









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PHP-DB] Pulling Date from MySQL then subtract
Bastien Koert

2005-01-22, 3:55 pm

you can use date-sub in the sql command (see the mysql manual) or use
mktime() function in php

bastien

>From: "Jess Hunter" <jlhunter@insightbb.com>
>To: <php-db@lists.php.net>
>Subject: [PHP-DB] Pulling Date from MySQL then subtract
>Date: Sat, 22 Jan 2005 08:37:56 -0600
>
>I am needing some clarification on doing math with dates pulled from MySQL.
>The date format in the database is YYY-MM-DD and what I want to do is pull
>the date out, then add/subtract 30 days from the date.
>
>I have read through the manual, but for some reason, I'm just not getting
>it.
>
>Any help and/or examples would be greatly appreciated.
>
>Jess
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.832 / Virus Database: 566 - Release Date: 1/10/2005
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com