Re: [PHP-DB] Date Formatting in PHP

2003-06-10 Thread David Shugarts


This worked perfectly, is very simple for me to use, and I would never have
come upon it in 10,000 years of trying. Thanks!

Thanks also to everyone who offered ideas.

> $f_date = date('F d, Y',strtotime($db_date));


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



Re: [PHP-DB] Date Formatting in PHP

2003-06-10 Thread CPT John W. Holmes
> I have a simple need to reformat a variable coming in as $DatePick,
brought
> forward from a MySQL select in the format:
>
> 2003-11-18
>
> I need to convert it to the format
>
> November 18, 2003

$f_date = date('F d, Y',strtotime($db_date));

---John Holmes...


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



Re: [PHP-DB] Date Formatting in PHP

2003-06-10 Thread John R Wunderly
At 05:23 PM 6/10/2003 -0400, David Shugarts wrote:


I have a simple need to reformat a variable coming in as $DatePick, brought
forward from a MySQL select in the format:
2003-11-18

I need to convert it to the format

November 18, 2003
try the "dice-n-slice" method.  use substr and concatenation to build 
$DayReport from the current value of $DatePick.

I am trying to avoid having to mess with the MySQL select statement, as the
output is being passed through several documents. So I need to do it within
PHP.
I tried making a conversion like

$DayReport = date ("F d, Y", $DatePick);

But the value of $DayReport is neither correct nor does it change when
$DatePick changes. For instance, in this example, the $DatePick value of
"2003-11-18" gets converted to "December 31, 1969."
TIA

Dave Shugarts



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


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


Re: [PHP-DB] Date Formatting in PHP

2003-06-10 Thread Frank Keessen
Hi David,

Try this one:



Regards,

Frank
- Original Message - 
From: "David Shugarts" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 11:23 PM
Subject: [PHP-DB] Date Formatting in PHP


>
>
>
> I have a simple need to reformat a variable coming in as $DatePick,
brought
> forward from a MySQL select in the format:
>
> 2003-11-18
>
> I need to convert it to the format
>
> November 18, 2003
>
> I am trying to avoid having to mess with the MySQL select statement, as
the
> output is being passed through several documents. So I need to do it
within
> PHP.
>
> I tried making a conversion like
>
> $DayReport = date ("F d, Y", $DatePick);
>
> But the value of $DayReport is neither correct nor does it change when
> $DatePick changes. For instance, in this example, the $DatePick value of
> "2003-11-18" gets converted to "December 31, 1969."
>
> TIA
>
> Dave Shugarts
>
>
>
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



[PHP-DB] Date Formatting in PHP

2003-06-10 Thread David Shugarts
 


I have a simple need to reformat a variable coming in as $DatePick, brought
forward from a MySQL select in the format:

2003-11-18

I need to convert it to the format

November 18, 2003

I am trying to avoid having to mess with the MySQL select statement, as the
output is being passed through several documents. So I need to do it within
PHP.

I tried making a conversion like

$DayReport = date ("F d, Y", $DatePick);

But the value of $DayReport is neither correct nor does it change when
$DatePick changes. For instance, in this example, the $DatePick value of
"2003-11-18" gets converted to "December 31, 1969."

TIA

Dave Shugarts



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