Re: A little confused

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 23.04.13 12:07, schrieb Chris Knipe:
> Hi All,
>
> $_SESSION['ExpiryDate'] = "2013-04-23";
> echo date_format($_SESSION['ExpiryDate'], "D, \t\h\e jS \o\f M Y");
>
> Required Result: Mon, the 23rd of Apr 2013
>
> I get however:  PHP Warning:  date_format() expects parameter 1 to be
> DateTime, integer given in
>
> I've had a look at the date/time function list, but I cannot seem to find
> any way to convert $_SESSION['ExpiryDate'] to an DateTime??

Take a look at this:
http://de3.php.net/manual/en/datetime.createfromformat.php

Or try this

http://de3.php.net/manual/en/function.strtotime.php

$_SESSION['ExpiryDate'] = "2013-04-23";
$int_timestamp = strtotime($_SESSION['ExpiryDate']);
echo date('D, \t\h\e jS \o\f M Y', $int_timestamp );

Use SINGLE QUOTES!


>
> --
> Chris.
>
>
>


-- 
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: marco@xxxxxxxxxx

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz


Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux