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: ma...@behnke.biz

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

http://www.behnke.biz


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to