Anyone have a function to get a timestamp time() in daylight savings time? And possibly GMT+1 insted of GMT. I need it to display timestamps of comments made on my site.
Anyone have a function to get a timestamp time() in daylight savings time? And
Share
Timestamps are the number of seconds elapsed since January 1st, 1970 GMT. That’s a fixed number, not depending on whether you’re saving daylight and independent of timezones. When you convert back to “human readable time”, that’s when your timezone and DST settings need to be taken into account. Set your timezone correctly or explicitly set a timezone on a DateTime object when formatting a timestamp to make this work.