How to make online shopping app available to accept orders only in shop opening hours?

Hello, hope you all are doing well.
I generally don’t ask question before trying multiple times and searching it in forum.
But this time i got stuck and i was unable to find solution.
My question is I am creating online shopping app all work is completed but i m trying again and again “how to make app available to accept orders only specific time?”
i.e If shop time is from 07:30 AM to 10:30 PM, then only in between this duration users can place orders. Otherwise users should get the shop closed message.
Here is what I tried:


Please help me.

This post was flagged by the community and is temporarily hidden.


Try to set the string the same
For example: hh:mm:ss (22:30:00)

1 Like

tried but no results.


change to this block, should work, remember that the a on the time format is for time format with AM/PM

4 Likes

Thanks @Chocoduba_BR my friend. It worked. Thanks a lot.

or without an extension:

2 Likes

I see you have your solution but just want to point out the problem with using clock.now instance to verify time before allowing a feature or use-case is that when user changes the time on their device, they can deceive your app and still place order in the app.

1 Like

I would recommend using DateTools extension to use UTC time so no one can finesse around the security even while using VPN and changing their time zone.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.