@dazza ... if you are using a php page why use the clunky js routine ?
Just goto the top of this page.
These are 'one-off' codes in that they only check when the page with the code loads.
With the php solution you can check the age of eg. realtime.txt and not be dependent on the 'holding' page being uploaded continously - which if you are using php and ajax you don't need every page uploaded frequently, only its content via the data uploads.
In regards to the js script .... you are using CuMX, the time / date formats are different - the then_month is giving nonsense figures
Code: Select all
var then_month = <#timeUTC format=mm> -1;
var then = Date.UTC(<#timeUTC format=yyyy>, then_month, <#timeUTC format="dd', 'hh', 'mm', 'ss">);
Needs to become
Code: Select all
var then_month = <#timeUTC format=MM> -1;
var then = Date.UTC(<#timeUTC format=yyyy>, then_month, <#timeUTC format="dd', 'HH', 'mm', 'ss">);