Hi,
Since the timezones have changed to daylight saving hours, my sig is no longer functioning correctly - it always thinks Winamp is off (note: only 99% sure its the time change thats causing this and not something I've done).
I've tried many things, changing the php timezone, making sure each reference to the time, date, etc uses GMT timing only, etc - yet I still can't seem to fix the issue.
Basically, I use a bit of code to work out whether Winamp is currently playing the song shown by comparing the length of the song to the time when the file containing the info was modified.
I don't expect a sollution to be found from the code I've provided, but if anyone can shed some light on how/if timezones can affect date, time and filemtime then that'd be great..
I've so far tried setting a timezone for the file (putenv("TZ=Europe/London");), using gmdate and gmmktime.
Thanks.
Edit: I originally felt that the timezone has no effect on any time/date reference made, as it uses GMT by default and the seconds are marked from a set time. My testing has backed up my guess, yet I'm still confused as to whats caused my sig to no longer function correctly.
Since the timezones have changed to daylight saving hours, my sig is no longer functioning correctly - it always thinks Winamp is off (note: only 99% sure its the time change thats causing this and not something I've done).
I've tried many things, changing the php timezone, making sure each reference to the time, date, etc uses GMT timing only, etc - yet I still can't seem to fix the issue.
Basically, I use a bit of code to work out whether Winamp is currently playing the song shown by comparing the length of the song to the time when the file containing the info was modified.
Code:
$last_update = date("U", filemtime("winamp.txt")); // song start time
$time_elapsed = time() - $last_update; // seconds into song
I don't expect a sollution to be found from the code I've provided, but if anyone can shed some light on how/if timezones can affect date, time and filemtime then that'd be great..
I've so far tried setting a timezone for the file (putenv("TZ=Europe/London");), using gmdate and gmmktime.
Thanks.
Edit: I originally felt that the timezone has no effect on any time/date reference made, as it uses GMT by default and the seconds are marked from a set time. My testing has backed up my guess, yet I'm still confused as to whats caused my sig to no longer function correctly.
Last edited: