Welcome Guest, Not a member yet? Register   Sign In
this->output class problem
#1

[eluser]Skoobi[/eluser]
Hi im struggling to get the output class working correctly on my site.
Im trying to add the

Code:
$this->output->set_header('Last-Modified: '.date('Y m d H:i:s', $content['created']).' GMT');

If i echo the $content['created'] i get 2014-07-05 06:30:26

But i get this error:

Severity: Notice
Message: A non well formed numeric value encountered
Filename: includes/header.php


Any ideas??

Many Thanks
Chris
#2

[eluser]Tpojka[/eluser]
Try with MySQL DATETIME format:
Code:
Y-m-d H:i:s
#3

[eluser]Skoobi[/eluser]
Yep tried that one as well but still the same.
#4

[eluser]Tpojka[/eluser]
I've just searched for some solution on google.
Check these links (if you didn't already):
Function strtotime();
Topic here.
#5

[eluser]jonez[/eluser]
Missing hyphens and you have to run your variable through strtotime.
Code:
date( 'Y-m-d H:i:s', strtotime( $content[ 'created' ] ) )
#6

[eluser]Skoobi[/eluser]
Ah that seems to have sorted the issue. Many thanks to you all for helping.




Theme © iAndrew 2016 - Forum software by © MyBB