Welcome Guest, Not a member yet? Register   Sign In
date format error
#1

[eluser]Mutsop[/eluser]
Hi,

I'm trying to format my date using the date_helper... But I do get an error for some reason.
Quote:A PHP Error was encountered
Severity: Notice
Message: A non well formed numeric value encountered
Filename: helpers/date_helper.php
Line Number: 94

Controller:
Code:
$data['datestring'] = "%Y-%m-%d";

View:
Code:
<?php echo mdate($datestring, $item->datum); ?>

Without using the date_helper I get this format:
Quote:2011-01-11 00:00:00
#2

[eluser]Mutsop[/eluser]
Nvm Found it....
Had to change this:
Code:
<?php echo mdate($datestring, $item->datum); ?>

to this:
Code:
<?php echo mdate($datestring, strtotime($item->datum)); ?>

Forgot the strtotime Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB