php - Converting a MySQL database row time timezone -
so have made ridiculously complicated accident because don't think can have individual timezones per database in mysql if they're on same account?
basically of databases american users , use 1 of american timezones, run english blog.
my issue english blog has correct bst (gmt+1) value inserted datetime row it's in database uses mdt timezone.
i need time rss feed using:
$date = date('r', $data['date']); //mdt system $data['date'] gmt+1
but gives me time in future @ time of blog post due incorrect timezone.
is there way can convert bst mdt?
but gets more complex because months of year in england use gmt (gmt+0) instead of bst (gmt+1) ... there anyway work out timezone being used in england @ time of year , conversion or way overcomplicating whole matter?
the following solution works perfectly:
$olddate = date('l f j y h:i:s', $link['date']); $date = new datetime($olddate, new datetimezone('europe/london')); $date->settimezone(new datetimezone('utc')); echo $date->format('r');
Comments
Post a Comment