I am not sure if any current router evaluates hours. But I think you should rather use a conditional access restriction.
access:conditional = yes @ (Apr 01-Sep 30 Mo-Su,PH 08:00-18:00; Oct 01-Mar 31 Mo-Su,PH 08:00-16:00)
access:conditional = no @ (Apr 01-Sep 30 Mo-Su,PH 00:00-08:00, 18:00-24:00; Oct 01-Mar 31 Mo-Su,PH 00:00-08:00, 16:00-24:00)
The first variant closes the gate for everyone and always if the conditional access is not evaluated, the second variant has it open by default.
Please chose the appropriate access tag (access, foot, bicycle, etc.) based on the situation. If the opening hours not only apply to the single gate but to the whole cementary you could put these restrictions also on the ways.
In order to make the gate routeable, there should be a highway way connecting the gate to the road.
Apart from that, I agree with TZorn that conditional restrictions would be the best tool for this situation. The semantics of opening_hours for access restrictions aren’t so well defined. For example: Is the foot=yes something that’s always true, i.e. pedestrians can enter at all times, and vehicles only during opening hours? Or can vehicles never enter, and pedestrians only during opening hours? Using conditional restrictions, you can make that unambiguous. The former would use access:conditional, the latter foot:conditional.
I believe OSM-based routers do not support time-dependent restrictions yet (at least I’m not aware of any that do). It can be quite tricky to support that properly, because even if the gate is currently open, it might be closed by the time you reach it. It’s not impossible, though, and I think mapping such data is still an useful addition. Otherwise, we might get into a hen-and-egg situation where developers don’t add the feature because mappers have not provided the data that would make the feature worthwhile, and vice versa.