alisongaleon
alisongaleon

Reputation: 153

mysqli datetime with 3 extra minutes

I have a saved datatime type on database which is:

2014-03-31 18:00:00

now i'm trying to separate the date and time by doing this:

$date =  strtotime($row['timedate']);
$formatD = date('F d', $date);
$formatT = date('h:mA', $date);

but the output of my $formatT has always an extra 3 minutes, which in this case would output 6:03PM

Is there something i missed?

Thanks.

Upvotes: 0

Views: 45

Answers (1)

scrowler
scrowler

Reputation: 24405

m represents the month. You need to use i for minutes:

$formatT = date('h:iA', $date);

Upvotes: 2

Related Questions