I used strtotime("YYYY-MM-DD H:i:s")
and this gave me a time 2 hours automatically subtracted.
eg: strtotime("2016-05-11 00:00")
gave me int(1462917600)
this is 2 hours negative to what I have input.
Which is: 2016-05-10 22:00
when i reconvert.
Why is this?
From the docs:
Each parameter of this function uses the default time zone unless a time zone is specified in that parameter.
So my guess is that you're in a time zone where 2016-05-11 00:00:00 local is 2016-05-10 22:00:00 UTC.
The integer result will always be in "seconds since the Unix epoch" which uniquely identifies an instant in time. To convert either to that or from that, you should consider the time zone you want to use.
See more on this question at Stackoverflow