# How do you setup seasonal time frame

Our business is very seasonal. Our business hours are shorter in the summer months. Right now I have been changing the time frame for Business and Outside of Business every year. ie: 06/01/15 - 08/30/15 to 01/01/16 - 08/30/16 . What I would like to do is something like: 06/01/** - 08/30/**. Any help would be appreciated. Thanks

Iād do it with multiple GotoIfTime statements and some logic around them to determine which schedule you should be on.

I have one case where I have to handle MST/MDT time differences and check for that.

``````exten => s,n,Set(TIME1=\${EPOCH}); Current number of seconds since the Epoch
exten => s,n,Set(DATEMST=\${STRFTIME(\${TIME1},MST,%Y-%m-%d %H:%M:%S)}); Local time
exten => s,n,Set(DATEMDT=\${STRFTIME(\${TIME1},MST7MDT,%Y-%m-%d %H:%M:%S)});Mountain Daylight Time
exten => s,n,Set(DATEDIFF=\${MATH(\${STRPTIME(\${DATEMDT},GMT,%Y-%m-%d %H:%M:%S)}-\${STRPTIME(\${DATEMST},GMT,%Y-%m-%d %H:%M:%S)},int)}); Subtract MST from MDT
exten => s,n,Set(DATEDIFF=\$[((\${DATEDIFF}/60)/60)]); Convert to hours
exten => s,n,GotoIf(\$["\${DATEDIFF}" = "1"]?MDT:MST);If there is an hour different then use the MDT schedule, otherwise use the MST Schedule
exten => s,n(MST),GotoIfTime(6:00-16:29,mon-fri,*,*?DAY:NIGHT)
exten => s,n(MDT),GotoIfTime(5:30-16:29,mon-fri,*,*?DAY:NIGHT)``````
1 Like