Time.Now with minutes

Catalog of dial plans
Post Reply
jvwelzen
Posts: 716
Joined: Thu Sep 11, 2008 1:56 pm

Time.Now with minutes

Post by jvwelzen » Thu Apr 16, 2009 9:20 am

TheFug and I where trying to write some code for the Time.Now Function

in the old situation this was for the hours but when the hour is going pas 00:00 the it is not working anymore

Code: Select all

if (23..8) === t.hour # only works until 00:00
this is working

Code: Select all

(7..23) === t.hour
Now i was trying this code and it seems working

Code: Select all

 t = Time.now + (2*60*60) 
  sys.Log(t.strftime('time: %c')) 
  tijd = t.strftime('%H:%M') 
  sys.Log("Tijd : #{tijd}") 

if ('22:15') < tijd || ('07:30') > tijd 

sys.Respond(486. "User is not Online ?") 

end 
If anyone have some more idea's please let us know

Post Reply