Hi,
im a php/mysql newbie..
i have a date and time stored as int in sql
example like this
1333239000
how do i display this in my php page
to be something like
25/6/2012 7.28am
Hi,
im a php/mysql newbie..
i have a date and time stored as int in sql
example like this
1333239000
how do i display this in my php page
to be something like
25/6/2012 7.28am
got it
PHP Code:
".date('Y-m-d', $datesub)."
more specifically, to follow your posted format:
PHP Code:<?php
$datesub = 1340634480;
// unix timestamp
$format = 'j/n/Y g.ia';
// j = day of month (no leading zero - use "d" if you want a leading zero)
// n = month of year (no leading zero)
// Y = full year
// g = hour of day (12-hour format, no leading zero)
// i = minute of hour
// a = lowercase am/pm
print date( $format,$datesub );
// prints "25/6/2012 7.28am"
Last edited by traq; 04-06-2012 at 03:36 AM.
mulaus (04-06-2012)
Tq Traq
Bookmarks