No, it isn't a bug. strtotime()
expects integer values in relative format. Thus, your +2.5
hours would be treated as "+2 GMT"
and then "+5"
hours and dot would be just ignored. You can change it to comma or even delete as well - result won't change since, again, only integers are parsed. So, such statement will be treated as relative hours addition with respect of GMT offset:
//this is the same things:
//and they mean set timesone to GMT+2 & add 5 hours:
date('Y-m-d H:i:s', strtotime('now +2.5 hours'));
date('Y-m-d H:i:s', strtotime('now +2,5 hours'));
date('Y-m-d H:i:s', strtotime('now +2 5 hours'));
So, for example, +1.5 hours
will do add 5 hours for time in GMT +1
. That means, end result will depend of current timezone since initial timestamp will be set to current timezone (it's now
in sample above).