Learn how to use Locksmith's "before" and "after" date and time key conditions, including when to combine them within a single key versus adding them as separate keys.
Locksmith includes two key conditions for controlling access by date and time.
Is visiting before a certain date and time
Grants access if the current time is before your chosen date.
Is visiting after a certain date and time
Grants access if the current time is after your chosen date.
These are best for one-off moments. Think launches, limited sales, or short blackout periods.
If you want access only between two dates, use one key. Add both conditions to that single key.
Example
Open access from March 10 at 9:00 AM. Close it March 17 at 9:00 AM.
Set up one key:
Permit if it's after March 10 at 9:00 AM
AND permit if it's before March 17 at 9:00 AM
Access is denied before March 10. Access is denied after March 17.
Use OR to grant access outside a time window
If you want to block access during a period, use two keys. No single moment can be both before a start and after an end.
Example
Block access during restocking. Restocking runs March 10 at 9:00 AM to March 17 at 9:00 AM.
Set up two keys:
Key 1: Permit if it's before March 10 at 9:00 AM
Key 2:OR, Permit if it's after March 17 at 9:00 AM
Before March 10, Key 1 grants access. After March 17, Key 2 grants access. During the window, neither key passes.
Impossible combined time conditions to avoid
Watch out for impossible conditions.
If you have time keys combined with "AND", and your "after" time is later than your "before" time, the key never opens. No moment can satisfy both at once.
This will never work in a single combined key:
Permit if it's after March 17
And permit if it's before March 10
If you're trying to allow access outside a window, use two keys instead. See the OR example above.
Quick reference
Open access after a single date
One key: "after [date]"
Open access until a single date
One key: "before [date]"
Open access during a window
One key: "after [start]" AND "before [end]"
Block access during a window
Two keys: "before [start]" OR "after [end]"
Date and time keys use your store time zone. Set it in Shopify under Settings > General.
If you need help changing it, see Shopify’s guide: https://help.shopify.com/en/manual/intro-to-shopify/initial-setup/setup-business-settings#set-or-change-your-store-time-zone