Content Timers
NOW:
INPUT DATE and/or TIME:
OUTPUT DATE and/or TIME:
SECONDS:
day+=86400; week+=604800; month(30)+=2592000; year(365)+=31536000
JS ALTERNATIVE:
<script> /********************************************************************************* * * CONTENT TIMER (use only for non-critical apps, client system-time dependent!) * Shows/hides content segment between given times * * PARAMETERS: * container id (content will NOT break before/after) * mode ('show'/'hide') * active (time/date when mode activated: 'mm/dd/yyyy[ hh:mm AM/PM]') * incative (time/date when mode deactivated: 'mm/dd/yyyy[ hh:mm AM/PM]') * *********************************************************************************/ function contentTimer(container,mode,active,inactive){ now_date=new Date(); in_date=new Date(active); out_date=new Date(inactive); // hide from active to inactive if(mode=='hide'){ var show_hide1='none'; var show_hide2='inline'; // show from active to inactive }else{ var show_hide1='inline'; var show_hide2='none'; } if((in_date.getTime() <= now_date.getTime()) && (out_date.getTime() > now_date.getTime())){ document.getElementById(container).style.display=show_hide1; }else{ document.getElementById(container).style.display=show_hide2; } } </script> <!-- REQUIRES START AND END DATES -->