date() + visible %

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
imstupid
Forum Commoner
Posts: 84
Joined: Fri Feb 18, 2005 1:24 pm

date() + visible %

Post by imstupid »

I've almost got this. It took me forever to rearrange the date from mysql in the format I wanted it to be displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.ange the date from mysql in the format I wanted it to be displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row&#1111;'edate'] = date(&quote;%m %d %Y&quo wanted it to be displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row&#1111;'edate'] = date(&quote;%m %d %Y", strtotime($row['edate'])) ;

echo $row['edthe correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y&qt now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.is. It took me forever to rearrange the date from mysql in the format I wanted it to be displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Prints this: %07 %15 %2005
is. It took me forever to rearrange the date from mysql in the format I wanted it to be displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.I wanted it to be displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.ayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Pr date from mysql in the format I wanted it to be displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.fee]
<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?&gt;


Prints mp;quote;, strtotime($row['edate'])) ;

echo $row['edate'];

?>


Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.e forever to rearrange the date from mysql in the format I wanted it to be displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.ere

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $rowї'edate'];

?&gt;


Prints this: %07 %15 %2005

can I escape those bad boys some hw['edate'])) ;

echo $row['edate'];

?>


Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.mp;lt;?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>


Prifetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>


Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.is. It took me forever to rearrange the date from mysql in the format I wanted it to be displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.];

?>


Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.rrange the date from mysql in the format I wanted it to be displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Prints this: %07 %15 %2005

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.earrange the date from mysql in the format I wanted it to be displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Printcode here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>


Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.amp;lt;?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>


Prints this: %07 %15 %2005

can I escape those bad boysamp;gt;


Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual. %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>


Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.forever to rearrange the date from mysql in the format I wanted it to be displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.11;'edate'])) ;

echo $row['edate'];

?>


Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.is. It took me forever to rearrange the date from mysql in the format I wanted it to be displayed in. But now that I've got the correct format, the % signs are showing up.

Code: Select all

<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>
Prints thi
<?PHP
// connect code here
// query code here

while($row = mysql_fetch_array( $result )) {

$row['edate'] = date("%m %d %Y", strtotime($row['edate'])) ;

echo $row['edate'];

?>


Prints this: %07 %15 %2005

can I escape those bad boys some how?

thanks as usual.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Code: Select all

$row['edate'] = date("m d Y", strtotime($row['edate'])) ;
But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
mp;quote;m d Y", strtotime($row['edate'])) ;


But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table&quotw['edate'])) ;
But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
ink you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
8c72578]

But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
$row['edate'] = date("m d Y", strtotime($rowї'edate'])) ;


But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y',
$row['edate'] = date("m d Y", strtotime($row['edate'])) ;
But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
ow['edate'])) ;


But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
;m d Y", strtotime($row['edate'])) ;


But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
amp;quote;SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
'edate'] = date("m d Y", strtotime($row['edate'])) ;


But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
table";
LECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
1]
$row['edate'] = date("m d Y", strtotime($row['edate'])) ;


But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
"m d Y", strtotime($row['edate'])) ;


But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', e72578]
$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
e("m d Y", strtotime($row['edate'])) ;


But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
%Y', edate) AS edate FROM table";
te;SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
) ;


But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
date'] = date("m d Y", strtotime($row['edate'])) ;


But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
$row['edate'] = date("m d Y", strtotime($row['edate'])) ;


But i think you should change your query:

Code: Select all

$query = "SELECT DATE_FORMAT('%m %d %Y', edate) AS edate FROM table";
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

the date function (in php) doesn't require the the % signs.

just use date("m/d/y") etc.

you might also be interested in a little function I wrote the other day:

viewtopic.php?t=35589
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

damn you tim...how did you edge me out of that one, I was typing as fast as I could...lol
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

*poke* that's because you're getting old :)
imstupid
Forum Commoner
Posts: 84
Joined: Fri Feb 18, 2005 1:24 pm

Post by imstupid »

thanks-
like usual, worked like a charm. I threw up a post in the "Theory and Design" forum since I'm struggling with the basics in case you guys get bored.
Post Reply