Re: Re: Date Question.
| From: | Sebastian | Date: | Wed, 05 Mar 2003 19:52:38 +0000 |
| Subject: | Re: Re: Date Question. | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-138349@lists.php.net to get a copy of this message | ||
Thank you very much, That worked well.
warm regards,
Sebastian.
----- Original Message -----
From: "Kevin Stone" <kevin@helpelf.com>
To: "Sebastian" <sebastian@dslr.net>; "Philip Hallstrom"
<philip@adhesivemedia.com>
Cc: "php list" <php-general@lists.php.net>
Sent: Wednesday, March 05, 2003 2:38 PM
Subject: Re: [PHP] Re: Date Question.
| He's recommending something like this..
|
| $tmp = explode(' ', $date);
| if (date("Y-m-d") == $tmp[0]) // date format yyyy-mm-dd
| {
| echo "Today";
| }
|
| Seems like a reasonable solution to me. Read the manual if you need more
| information..
| http://www.php.net/manual/en/function.explode.php
| http://www.php.net/manual/en/function.date.php
|
| - Kevin
|
|
| ----- Original Message -----
| From: "Sebastian" <sebastian@dslr.net>
| To: "Philip Hallstrom" <philip@adhesivemedia.com>
| Cc: "php list" <php-general@lists.php.net>
| Sent: Wednesday, March 05, 2003 12:32 PM
| Subject: Re: [PHP] Re: Date Question.
|
|
| > can you give an example? I am stil learning :)
| >
| > ----- Original Message -----
| > From: "Philip Hallstrom" <philip@adhesivemedia.com>
| >
| >
| > | Strip off the H:i:s part using explode() and use date() to get an
| > | equivalent string for right now and if they match, today's the day.
| > |
| > | On Wed, 5 Mar 2003, Sebastian wrote:
| > |
| > | > I have a date field in mysql in this format: Y-m-d H:i:s
| > | >
| > | > I would like to echo "Today" if the date is today, can someone offer
| > some
| > | > help? Thanks.