Key:opening_hours - OpenStreetMap Wiki
Key:opening_hours
From OpenStreetMap Wiki
Jump to navigation
Jump to search
Help
Key:opening hours
In other languages
Afrikaans
asturianu
azərbaycanca
Bahasa Indonesia
Bahasa Melayu
bosanski
brezhoneg
català
čeština
Crnogorski
dansk
eesti
Esperanto
euskara
Frysk
Gàidhlig
galego
hrvatski
Ido
interlingua
íslenska
italiano
Kreyòl ayisyen
kréyòl gwadloupéyen
kurdî
latviešu
Lëtzebuergesch
lietuvių
magyar
Nederlands
norsk
norsk nynorsk
occitan
polski
português
română
sardu
shqip
slovenčina
slovenščina
srpski (latinica)
suomi
svenska
Tagalog
Tiếng Việt
Türkçe
Zazaki
Ελληνικά
беларуская
български
македонски
монгол
русский
српски / srpski
українська
հայերեն
עברית
العربية
سرائیکی
فارسی
پنجابی
پښتو
नेपाली
मराठी
हिन्दी
বাংলা
ਪੰਜਾਬੀ
தமிழ்
മലയാളം
සිංහල
ไทย
မြန်မာဘာသာ
한국어
ქართული
ⵜⴰⵎⴰⵣⵉⵖⵜ
中文(简体)
中文(繁體)
粵語
Other languages...
opening_hours
Description
Describes when something is open or closed in a standard format.
Group:
properties
URL pattern
Used on these
elements
Documented values:
See also
check_date:opening_hours
=*
opening_hours:url
=*
website:*
=*
service_times
=*
collection_times
=*
Status:
approved
opening_hours
More details at tag
info
Tools for this tag
taginfo
AD
AT
BE
BR
BY
CH
CN
CZ
DE
DK
FI
FR
GB
GR
HU
IE (N+S)
IN
IR
IT
LI
LU
JP
KP
KR
NL
NO
PL
PT
RU
ES
AR
MX
CO
BO
CL
EC
PY
PE
UY
VE
TW
UA
US
VN
overpass-turbo
QLever
Postpass via overpass-turbo
OSM Tag History
Many editors offer a special interface allowing easier editing of these data; here,
StreetComplete
quest is pictured with editing opening hours data in progress.
opening_hours
=*
describes when a feature is open or closed in a standard format. For example,
opening_hours
Mo-Fr 08:00-17:00
specifies being open from every day Monday to Friday, from 8:00 to 17:00. Far more complex cases can be also recorded.
Key:opening_hours/specification
is a formal specification.
Proposed features/Time domains
is an historic document with some more background.
Contents
How to map
1.1
Tags used in combination
Explanation by example
2.1
Open on weekdays
2.2
Multiple opening intervals
2.3
Multiple days same time periods
2.4
Multiple days and multiple time periods
2.5
Closed on holidays
2.6
Different hours on holidays
2.7
Closing after midnight
2.8
Exception based on month
Values
3.1
Examples
Summary syntax
4.1
Syntax
4.2
Rules
4.3
Common mistakes
4.4
Non-Gregorian calendars
Usage on highways
5.1
Current usage of opening_hours on highways
5.2
Router support
Standards
Implementation
7.1
JavaScript
7.2
Java
7.3
Kotlin
7.4
PHP
7.5
Python
7.6
C++/Qt
7.7
Go
7.8
Rust
7.9
CartesApp
7.10
OsmAnd
7.11
Opening hours for Ulm, Neu-Ulm, and surroundings
7.12
More maps and applications
Rendering
Former tags, now deprecated
10
Related tags
11
See also
12
External links
13
References
How to map
Opening hours are an attribute, so must go with an existing object; e.g.,
shop
=*
amenity
=*
tourism
=*
. It is possible to enter opening hours for almost everything that has known hours of operation. The syntax is quite complex, but it allows even some highly complicated rules.
For most mappers, rather than attempting to edit tag values directly, it is better to make use of special tools like the
OpeningHoursEditor plugin
in
JOSM
(can be added in plugin menu in preferences), built-in special editor in
Vespucci
Go Map!!
OsmAnd
Every Door
StreetComplete
opening hours quest, or
evaluation tool
and
YoHours
web tools.
This tools allow to use more friendly GUI to construct opening hours text that will go into tag.
Note that some tools like
Organic Maps
have interface that has a very limited understanding of opening hours syntax and will fail with more complex data.
Tags used in combination
check_date:opening_hours
=*
— the date when the opening hours was last checked;
opening_hours:url
=*
— the URL where the current opening hours of an object can be accessed;
source:opening_hours
=*
— to describe the source;
Explanation by example
Open on weekdays
Weekdays are abbreviated to 2 letters as follows:
Abbr.
Day of week
Mo
Monday
Tu
Tuesday
We
Wednesday
Th
Thursday
Fr
Friday
Sa
Saturday
Su
Sunday
Multiple opening intervals
opening_hours
Mo-Fr 08:00-
-17:30
Same as above, but closed from 12:00 to 13:00 (noon to 1 PM)
Add the two time intervals in which they are open, separated by a
comma without spaces
(,).
Multiple days same time periods
opening_hours
Mo,We
08:00-12:00
Open on Monday and Wednesday from 08:00 to 12:00
Add days separated by a
comma without spaces
(,).
Multiple days and multiple time periods
opening_hours
Mo-Fr 08:00-12:00,13:00-
; S
00-12:00
Same as above, also open on Saturday mornings
Add the opening hours for each day range, separated by a
semicolon with following space
(; ).
Closed on holidays
opening_hours
Mo-Fr 08:00-12:00,13:00-17:30; Sa 08:00-
; PH off
Same as above, but explicitly tagged as closed on public holidays
Use
PH
as if it were a weekday. Instead of hours, use
off
to say they're closed all day.
Use
SH
for school holidays. Although this is rare, you can also use both
PH
and
SH
on the same object; e.g.
opening_hours
Mo-Fr 08:00-12:00,13:00-17:30; Sa 08:00-
; PH off; SH off
Different hours on holidays
opening_hours
Mo-Fr 08:00-12:00,13:00-17:30; Sa 08:00-
; PH 09:00-12:00
On holidays, they are open from 09:00 to 12:00
As said before,
PH
is just like a weekday. Because it is to the right of the rest of the rules, it overwrites them. For more information on which rules take precedence, see
this more elaborate guide
If a feature has different opening hours on some days during the school holidays,
SH
can be used as a prefix to the weekdays:
opening_hours
Mo-Fr 08:00-12:00,13:00-17:30; Sa 08:00-12:00
; SH Mo-Sa 09:00-12:00
(The feature in this example is open Monday to Saturday 9am to 12pm during the school holidays, but has different opening hours out of the school holidays.)
Closing after midnight
In some cases places are closing after midnight. For example place opening on Monday at 20:00 and closing after midnight, at 2:00 can be marked in following ways - which are all valid, according to
specification
opening_hours
Mo
20:00-26:00
Open on Monday at 20:00, closed 2:00 — using
extended hour syntax
opening_hours
Mo
20:00-02:00
Open on Monday at 20:00, closed 2:00 — using
extended hour syntax
Note: This might yield a spurious warning in some validators.
opening_hours
Mo
20:00-24:00
, Tu
00:00-02:00
Open on Monday at 20:00. Closed on Tuesday at 2:00. - with tagging Tuesday chunk separately
Caution
opening_hours
Mo
20:00-26:00
; Tu
20:00-24:00
Open on Monday and Tuesday at 20:00 and closed at midnight. (!)
Because following rules cause previous ones to be ignored, Tuesday rule overwrites the Tuesday open from 0:00 to 2:00 o'clock chunk. Make sure to use a comma instead of a semicolon to extend the rule! In general, using comma is almost always preferable.
Exception based on month
Recall that following rules will overwrite previous ones.
To describe in every month, the nth occurrence of a weekday:
opening_hours
Mo 08:00-16:00; Mo
[2]
08:00-12:00
Open on Mondays from 8:00 to 16:00, but on the second Monday of each month, open from 8:00 to 12:00.
To describe, in every month, the nth to last occurrence of a weekday:
opening_hours
Mo 08:00-16:00; Mo
[-2]
08:00-12:00
Open on Mondays from 8:00 to 16:00, but on the
second to last
Monday of each month, open from 8:00 to 12:00.
To describe every day of a month:
opening_hours
Mo 08:00-16:00;
Dec
off
Open on Mondays from 8:00 to 16:00, but closed in December.
Months are abbreviated to the first three letters of their name: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec.
To describe a day of a month:
opening_hours
Mo-Fr 08:00-16:00;
Dec 12
off
Open on Mondays to Fridays from 8:00 to 16:00, but closed on December 12th.
Months can be combined with weekdays.
opening_hours
Mo 08:00-16:00;
Dec Mo
08:00-12:00
Open on Mondays from 8:00 to 16:00, but in December is open on Mondays from 8:00 to 12:00
Months can also be combined, or spanned, similarly to weekdays.
opening_hours
Mo 08:00-16:00;
Jan-Mar
Mo 08:00-12:00
Open on Mondays from 8:00 to 16:00, but in January to March is open on Mondays from 8:00 to 12:00
Values
For
traversable ways, see
Key:access
Examples
24/7
Applied to: any non-stop facilities (related tags), 24 hours a day, 7 days a week
Render on map: something like object icon with a 24
(note: there seems to be some
disagreement
whether
"24/7"
includes public holidays or not, so it is safer to mark it explicitly e.g.
"Mo-Su,PH 00:00-24:00"
or
"Mo-Su 00:00-24:00; PH off"
instead)
Sa-Su 00:00-24:00
Applied to: opens only the weekend but non-stop, 24 hour
Mo-Fr 08:30-20:00
or for more complex opening hours:
Mo 10:00-12:00,12:30-15:00; Tu-Fr 08:00-12:00,12:30-15:00; Sa 08:00-12:00
Mo-Su 08:00-18:00; Apr 10-15 off; Jun 08:00-14:00; Aug off; Dec 25 off
Applied to: any facilities with opening hours (related tags)
Render on map: nothing, information recovered by software
Mo-Sa 10:00-20:00; Tu off
or
Mo-Sa 10:00-20:00; Tu 10:00-14:00
For exceptions in a range of days
Applied to: any facilities with opening hours (related tags)
Render on map: nothing, information recovered by software
sunrise-sunset
Applied to: opens every day between sunrise and sunset.
Use round brackets to add a time offset, for example a park that opens 2 hours after sunrise and closes 2 hours before sunset (sunrise+02:00)-(sunset-02:00)
Su 10:00+
Sunday from 10:00 to an unknown or unspecified closing time.
Applied to: any facilities with opening hours (related tags)
Render on map: nothing, information recovered by software
Apr-Oct: Fr-Su 10:00-18:00
Open from 10:00 to 18:00 from Friday to Sunday, but only between April and October.
week 1-53/2 Fr 09:00-12:00; week 2-52/2 We 09:00-12:00
Open from 09:00 to 12:00 on Fridays of odd weeks and on the Wednesdays of even weeks
Applied to: any facilities with opening hours (related tags)
Render on map: nothing, information recovered by software
10:30-19:00; Jan 01-31/2,Feb 01-29/2,Mar 01-31/2,Apr 01-30/2,May 01-31/2,Jun 01-30/2,Jul 01-31/2,Aug 01-31/2,Sep 01-30/2,Oct 01-31/2,Nov 01-30/2,Dec 01-31/2 07:30-13:30; Su 10:00-13:00; Sa off
Open from 10:30 to 19:00 on even dates and from 7:30 to 13:30 on odd dates, but from 10:00 to 13:00 on Sundays and closed on Saturdays
Mo-Sa 08:00-13:00,14:00-17:00 || "by appointment"
Here does the
fallback rule
come in handy. It applies for any time which was not handled by previous rules.
Su-Tu 11:00-01:00, We-Th 11:00-03:00, Fr 11:00-06:00, Sa 11:00-07:00
Because of the definition that following rules will overwrite previous ones, times which span over midnight have to use additional rules which are separated by a comma instead of a semicolon.
Mo-Su,PH 15:00-03:00; easter -2 days off
Every day, even on public holiday open, but closed on Good Friday.
Dec 11-Dec 17: Su 10:00-17:00
Open on the 3rd Advent (which cannot take place before the 11th or after the 17th December) from 10:00 a.m. to 5:00 p.m.
Mo-Fr 09:00-12:30,13:30-17:00; PH -1 day 09:00-12:30; Sa-Su,PH off
Open Monday to Friday from 9:00 to 12:30, and from 13:30 to 17:00 except on weekdays before public holidays, and closed on weekends and public holidays.
For more examples check out the
evaluation tool
and the
documentation
of opening_hours.js.
Summary syntax
This is a summary covering most cases. Its goal is to allow writing most opening hours tags in a short time, not to explain the full syntax. For more complicated cases, please refer to the text below this section, to
the full specification
and to
more explanations
You can check your compositions with the
evaluation tool
, or the simpler
YoHours
application (YoHours doesn't support.advanced features of the syntax
).
Legend
code
is either written literally as such (including a literal space separator
where needed; elsewhere spaces in the syntax are only for its presentation);
element
is to be replaced by the
element
whose syntax is defined in a line starting by
element
below;
item
... means that
item
can be repeated as needed.
sequence of items
] means that the
sequence of items
is optional;
| indicates that one of the sequences of items (separated by this symbol) must be chosen;
General syntax
opening_hours=
rulesets
rulesets
]...
Each
ruleset
is evaluated in order, the next
ruleset
possibly overriding the initial open or closed state that may have been matched in the previous
ruleset
s.
rulesets
rule
||
rule
]...
Each
rule
is evaluated in order until it matches for the indicated dates or times, otherwise the next
rule
in the
ruleset
will be checked only as a fallback.
rule
range
status
] [
comment
range
years
dates
times
] |
times
24/7
Syntax for specifying optional years
years
year_range
year_range
]...
year_range
year
year
] [
An optional period of
years may be specified for years to include within the specified range starting at the first specified
year
year
A 4-digit year number in the Gregorian calendar.
Syntax for specifying dates (with optional times
dates
monthly
weekly
daily
variably
holidays
monthly
monthdays
weekdays
weekly
week
week_range
week_range
]...
weekday_range
weekday_range
]...
daily
months
monthdays
monthdays
]... ]
variably
variable_date
variable_date
months
Mth
Mth
monthdays
dd
dd
week_range
ww
ww
] [
An optional period of
weeks may be specified for weeks to include within the specified range starting at the first specified week number
ww
weekdays
weekday_range
weekday_range
]... |
Wd
]...
Week days may be followed by rank numbers, counted positively from the start of the month, or negatively from the end of month:
e.g.
Mo-Fr
08:00-09:00
, or
Mo[1,3]
08:00-09:00
e.g.
Su[1]
means the first Sunday of the month, and
Su[-1]
means the last Sunday of the month.
weekday_range
Wd
Wd
ww
A 2-digit week number (in ISO year) in range 01-53, e.g.
week
25
Mo 08:30-20:00
dd
A 2-digit monthday number in range 01-31, e.g.
Dec
25
Mth
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
A 3-letter abbreviated English month name, e.g.
Dec
25
Wd
Mo
Tu
We
Th
Fr
Sa
Su
A 2-letter abbreviated English weekday name, e.g.
Fr
08:30-20:00
yearly_fest
easter
For now, the only variable yearly fest day specified is Easter (assuming the Christian Gregorian calendar).
variable_date
yearly_fest
sign
days
], e.g.
easter -2 days 08:00-17:00
for opening hours on Good Friday, or
easter +49 days 08:00-17:00
for opening hours on Whitsun/Pentecost.
holidays
PH
sign
days
] |
SH
Public holiday (location dependent, requires data per country/region); scholar holiday (location dependent, requires data per scholar academy).
Syntax for specifying times
times
time_range
time_range
]...
time_range
time
time
This may be used in place of "late" or "until last customer", e.g.
12:00+
time
fixed_time
variable_time
fixed_time
HH
mm
variable_time
event
event
offset_time
event
dawn
sunrise
sunset
dusk
Note that sunset and sunrise times requires geolocation to compute the position angular elevation of the sun, and the the angular elevation of the observable horizon (which is also dependent of the altitude). They may be approximated at sea level on the modelling geoid, or just estimated roughly in local time (per country and time zone).
offset_time
sign
hh
mm
hh
A relative 2-digit hours number in range 00-48, e.g.
(sunrise+
01
:00)-12:00
HH
An absolute 2-digit hours number (in day, in 24 hour format, no am/pm) in range 00-23, e.g.
Fr
08
:30-
20
:00
mm
A 2-digit minutes number (in hour) in range 00-59, e.g.
Fr 08:
30
-20:
00
Other generic syntactic elements used for tuning dates and times
sign
A positive integer.
Syntax for optional modifiers
status
unknown
open
closed
off
unknown
: initial open or closed state, except at overriding dates and times that follow (may also be used to override a previous explicit open or closed status);
open
: open at the indicated dates and times (or permanently if no time is given), except at overriding dates and times that follow;
closed
or
off
: closed at the indicated dates and times (or permanently if no time is given), except at overriding dates and times that follow;
In each
rule
of the first
ruleset
of the tag value (including fallbacks), if the
status
is not explicitly specified with the specified
range
, it is assumed to be meant as
open
(except when there is a
comment
for it), and all other unspecified dates and times are left as
unknown
. The resulting schedule is then successively modified by each following
ruleset
comment
text
A short comment (wrapped in
but not containing any
within) showing applicable restrictions or specifications, e.g.
"children only"
"limited service"
, or
"reservation by phone"
reservation
=*
This comment is intended to be displayed in applications and not to be interpreted automatically. The language used in this comment is not specified by the tag value itself, but this could be specified (for localisation purpose) by tags whose key contains a language code suffix.
Syntax
wd
weekday, available: Mo · Tu · We · Th · Fr · Sa · Su
Fr
08:30-20:00
hh
hour, always two digits number in 24 hour basis (no am/pm), in the format "hh:mm" ·
Fr
08
:30-
20
:00
mm
minute, always two digits number in the format "hh:mm"
Fr 08:
30
-20:
00
mo
month, available: Jan · Feb · Mar · Apr · May · Jun · Jul · Aug · Sep · Oct · Nov · Dec · "mo md"
Dec
25
md
monthday, always two digits number in the format · "mo md"
Dec
25
we
week number, always a two digit number in range 01-53, in the format "week we"
week 25
Mo 08:30-20:00
SH
School holidays. For the non-native English speakers, note that this also includes the
summer holidays
, so it's not limited to holidays during the school year.
Mo-Fr 08:00-09:00,14:00-15:00; SH off
PH
Public holiday, can be used to indicate different opening hours during public holidays
Mo-Fr 09:00-17:00; PH 10:00-12:00; PH Su off
The above example means normal hours are Monday to Friday 9 am to 5 pm, except on public holidays it is 10 am to 12 pm, except public holidays that fall on a Sunday.
The general syntax for the value is:
hh:mm-hh:mm
08:30-20:00
The general syntax for the value is:
wd hh:mm-hh:mm
Fr 08:30-20:00
The general syntax for the value is:
mo md: hh:mm-hh:mm
Dec 25: 08:30-20:00
Note that the colon is optional as mentioned under
Key:opening_hours/specification
The general syntax for the value is:
mo-mo: wd hh:mm-hh:mm
Jun-Aug: Su 10:30-16:00
to specify the opening times on Sundays in June, July and August. Note that the colon is optional as mentioned under
Key:opening_hours/specification
The general syntax for the value is:
week we: wd hh:mm-hh:mm
week 25: Mo 08:30-20:00
Note that the colon is optional as mentioned under
Key:opening_hours/specification
Rules
Consecutive hours [always needs open-close] separated by "
" ·
08:30
20:00
Consecutive weekdays open separated by "
" ·
Mo
Fr
Consecutive monthdays open separated by "
" ·
Dec 20
26
or
Dec 20
Jan 06
Open with periodicity "n" within a range of consecutive monthdays, the range is followed by "
/n
02-30
/n
Consecutive weeks open separated by "
" ·
week 01
26
Open with periodicity "n" within a range of consecutive weeks, the range is followed by "
/n
week 02-52
/n
A break on days separated by "
" ·
Mo
We
Fr
A break on hours separated by "
" ·
08:30-14:00
16:30-20:00
Different hours on different days can be separated by "
" (additive) or "
" (overwrite)
Mo-Sa 13:30-15:00,17:00-20:00
Tu-Sa 08:00-12:00
Th 11:00-16:00,17:00-19:00
reads as: these opening hours for these days ,(and) these opening hours for these days ;(but) these opening hours for these days.
A weekday off will be tagged as "wd off"
Tu
off
A range of weekdays off will be tagged as "wd-wd off"
Tu-Th
off
A month off will be tagged as "mo off"
Aug
off
A range of months off will be tagged as "mo-mo off"
Aug-Sep
off
A monthday off will be tagged as "mo md off"
Dec 25
off
A range of monthdays off
"mo md-md off"
Dec 24-26
off
"mo md - mo md off"
Dec 25-Jan 06
off
Exceptions to a range of days, first the range then the exception
Mo-Sa 10:00-20:00; Tu off
Mo-Sa 10:00-20:00; Tu 10:00-14:00
Mo-Fr 08:00-12:30; We 14:00-17:00
This means these are not additions, for example Mo-Fr 08:00-12:30; We 14:00-17:00 means that on Wednesdays, the shop is
only
opened in the afternoons and not
additionally
If it is in the first or last day of a range then don't use the exception rule, use the usual
Mo-Fr 10:00-20:00; Sa 10:00-14:00
Non-consecutive or semi-consecutive days of the week will be tagged as wd[x]
Su[3] 09:00-12:00
This is used to indicate the 3rd Sunday of the month from 9 am to 12 pm.
Use -1 to indicate the last day of the month; e.g., Aug Th[-1] means last Thursday in August.
Can use grouping,
Su[1,3,5] and Su[1-3]
If hours are non stop some days then
00:00-24:00
If it is 24 hours 7 days a week it has a specific value: 24/7.
This way it can render a specific icon.
A special time value to mark the time the sun rises is: sunrise.
A special time value to mark the time the sun sets is: sunset.
A + after a time means "from" or "open end"
Sa 22:00+ or Sa 18:00-22:00+
See the
formal specification
for more details.
Common mistakes
Incorrect
Correct
Notes
7/8-23
Mo-Su 08:00-23:00
0600-1800
06:00-18:00
07;00-2;00pm
07:00-14:00
08.00-16.00, public room till 03.00 a.m
08:00-16:00 open, 16:00-03:00 open "public room"
09:00-21:00 TEL/072(360)3200
09:00-21:00 "call us"
Add
contact:phone
072-360-3200
10:00 - 13:30 / 17:00 - 20:30
10:00-13:30,17:00-20:30
April-September;
Mo-Fr 09:00-13:00,
14:00-18:00, Sa 10:00-13:00
Apr-Sep:
Mo-Fr 09:00-13:00,14:00-18:00;
Apr-Sep: Sa 10:00-13:00
Dining in: 6am to 11pm;
Drive-through: 24/7
06:00-23:00 open "Dining in" ||
00:00-24:00 open "Drive-through"
or
opening_hours
06:00-23:00
opening_hours:drive_through
00:00-24:00
Using two tags has the advantage that it can be understood by software, e.g. to warn the user that only drive-through will be open on arrival.
MWThF: 1200-1800; SaSu: 1200-1700
Mo,We,Th,Fr 12:00-18:00; Sa-Su 12:00-17:00
BAR:
Su-Mo 18:00-02:00;
Tu-Th 18:00-03:00;
Fr-Sa 18:00-04:00;
CLUB:
Tu-Th 20:00-03:00;
Fr-Sa 20:00-04:00
Tu-Th 20:00-03:00 open "Club and bar";
Fr-Sa 20:00-04:00 open "Club and bar" ||
Su-Mo 18:00-02:00 open "bar" ||
Tu-Th 18:00-03:00 open "bar" ||
Fr-Sa 18:00-04:00 open "bar"
Su-Th 11:00-03:00; Fr-Sa 11:00-05:00
Su-Th 11:00-03:00, Fr-Sa 11:00-05:00
See last example
Mo-Su,PH 08:00-20:00; 2025 May 15 - closed
closed; 2020 Jan 01 - 2025 May 15 Mo-Su,PH 08:00-20:00
Open-ended date ranges (e.g. when shop has
announced shutdown
in the future) are not possible. Instead, invert the condition and use start date in the past.
Mo-We 17:00-01:00; Th,Fr 15:00-01:00; PH,Sa,Su off
Mo-We 17:00-01:00, Th,Fr 15:00-01:00; PH 01:00-01:00 off
Use
additional rules
. You cannot say "Sa,Su off" because that would set the time "Sa 00:00-01:00" to closed.
Same thing on public holidays, but we must stay closed between 00:00-01:00 the day after. So "off" for 24h starting at 01:00.
Non-Gregorian calendars
There has been some discussion about how to map non-Gregorian calendars (
“Opening hours syntax for non Gregorian calendar”
. 17 May 2019
).
Usage on highways
While time based restrictions are also tagged with
access:conditional
=*
, mappers also prefer / also add
opening_hours
=*
on
highway
=*
, since this scheme -typically using positive values instead of negative ones- has multiple advantages over
access:conditional
=*
in cases where the element is closed for all
modes of transport
on some specified moments:
no need to repeat the closure-tags for all tagged modes of transport (
foot:conditional
=*
bicycle:conditional
=*
horse:conditional
=*
+ .., which are needed since a mode-specific
foot
yes
overwrites a general
access:conditional
no @ ..
. - tag)
easier tagging with positive values for regular opening hours (such as
Mo-Fr 07:00-19:00; Sa-Su 10:00-17:00
;  the negative values in
access:conditional
=*
can give unexpected results in cases with different regimes on different days on the day of a regime change and the closure passes midnight
easier to make explicit that it has been established that the way is indeed open all days and all hours (
opening_hours
24/7
) for cases where this is not self-explanatory, such as path in nature areas where many are closed after sunset or seasonally (many paths
without
an access-conditional-tag in OSM are in reality closed at specified times)
easier to make explicit in one tag that that the element is indeed closed for all modes of transport (with
access:conditional
tags for all different modes of transport must be evaluated)
more support for checking / validating the results of syntax (
example
more support for visualizing current status (open/closed);
example
Current usage of opening_hours on highways
A more precise comparison of usage on
highway
=*
requires further analysis, since
access:conditional
=*
is not only used for time-based restrictions, but also for other types of restrictions, such as length, weight or weather circumstances. However this comparison of the
most frequently
used values might be illustrative:
Currently
opening_hours
sunrise-sunset
is used on slightly on more instances of
highway
=*
then
access:conditional
no @ (sunset-sunrise)
: 5.6k;
ohsome
vs 5.4k;
ohsome
Router support
Graphhopper do not support opening_hours on ways, and
do not intend to add it
as of March 2024. Instead it
supports access:conditional
Standards
The
opening hours syntax
has been incorporated by reference into the
General Bikeshare Feed Specification
(GBFS), version 3.0, an industry standard for
amenity
bicycle_rental
operators and transportation authorities.
Implementation
JavaScript
JavaScript implementation by
User:Ypid
Evaluation tool
Source code
Map showing elements with opening_hours
Python script
to search with regular expressions and to load values which could not be evaluated in
JOSM
(documentation in
README
).
Does follow the
formal specification
originally created by
Netzwolf
Based on initial coding and design done by
AMDmi3
Other implementations:
Web to OSM Opening Hours
- A tool for copy&pasting (almost) any website content and getting a decently formatted opening_hours-string. Contributions welcome on
GitHub
Java
OpeningHoursParser
Parser library
OpeningHoursEvaluator
OH evaluator based on the above
OpeningHoursFragment
Android OH editor library.
opening-hours-evaluator
Library to check if opening_hours are open at a certain time, uses OpeningHoursParser for parsing
Kotlin
osm-opening-hours
Parser (Multiplatform: JVM, JS, WASM, native)
PHP
PHP code in SVN
to parse opening_hours.
Services_Openstreetmap
, a PEAR PHP package for working with the OpenStreetMap (OSM) API, supports parsing a wide range of opening hours syntax -
with examples here
Python
KOpeningHours
Parser and validator
pyopening_hours
Wrapper for the javascript implementation (unmaintained, broken as of 2024 - see
humanized_opening_hours
Translator to human description, in multiple languages
(unmaintained)
opening-hours-py
parser and evaluator bindings from
Rust crate
C++/Qt
KOpeningHours
Parsing, validation and evaluation (status at a certain time, iteration over intervals)
Go
openhours
Parser and evaluation library
Rust
opening-hours-rs
parser and evaluation library (see
opening-hours-syntax
if you only need a parser)
CartesApp
Cartes.app
uses this key on the POIs chosen by the user by displaying green, red or white dots depending on whether the time falls within the opening or closing period or if the POI does not have any times specified in its opening_hours tag.
OsmAnd
OsmAnd 2.0 showing whether the POI is known to be open or closed based on tagging of opening_hours. For example, the my daBBA restaurant was closed when the screenshot was taken; however, Sugran Swayapakghar was open.
OsmAnd
uses this tag on the POI search screen. The implementation now includes more values (such as months and dates), added together with conditional restriction support.
Source Code
Opening hours for Ulm, Neu-Ulm, and surroundings
Ulm, Neu-Ulm and surrounding areas.
The web application is available on
. Opening hours for the local area are visualized on a map. The source code of this application is freely licensed and available via
GitHub
. Adapting the application to a different city is very easy and described on the GitHub page.
More maps and applications
Web applications:
openingh.openstreetmap.de
openingh.ypid.de
, Map with layer for the tag opening_hours.
OsmAPP
– universal viewing/editing tool, shows `opening_hours` on every feature and since 9/2024 offers a convenient editor for simpler use cases (
screenshots of the editor
Mobile apps:
My Opening Hours
for
Android devices
Vespucci
, full featured OSM editor for Android that includes special opening hours interface that includes support for highly complicated opening hours
StreetComplete
, newbie friendly OSM editor that allows to collect, among other data, opening hours information.
Tools:
statistics
Visualization of the data quality and growth over time.
YoHours
, a website to create opening hours simply by dragging time intervals on a calendar. It doesn't support.advanced features of the syntax.
can be used to convert/extract free-text opening hours into the OSM format using
natural language processing
Rendering
24/7
(around the clock) shouts out for special treatment, perhaps something like adding "24" to the object icon:
Any other special cases are much less obvious.
Maps showing opening hours:
openingh.openstreetmap.de map
open
only opening_hours with syntax errors
Former tags, now deprecated
The following (undocumented) keys have been
deprecated
and should be replaced by this
opening_hours
=*
. Their value should be interpreted to set the value of the new key, as described above:
date_on
More details at tag
info
More details at tag
info
date_on
=*
If you know
places with this tag
, verify if it could be tagged with another tag.
Automated edits are
strongly discouraged
unless
you really know what you are doing
date_off
More details at tag
info
More details at tag
info
date_off
=*
If you know
places with this tag
, verify if it could be tagged with another tag.
Automated edits are
strongly discouraged
unless
you really know what you are doing
day_on
More details at tag
info
More details at tag
info
day_on
=*
If you know
places with this tag
, verify if it could be tagged with another tag.
Automated edits are
strongly discouraged
unless
you really know what you are doing
day_off
More details at tag
info
More details at tag
info
day_off
=*
If you know
places with this tag
, verify if it could be tagged with another tag.
Automated edits are
strongly discouraged
unless
you really know what you are doing
Related tags
opening_hours:signed
no
- When the opening hours are not posted on a sign visible externally
The following keys use the same syntax for different purposes:
opening_hours:*
=*
opening_hours:atm
=*
opening hours:bar
=*
opening_hours:covid19
=*
opening_hours:drive_through
=*
opening_hours:kitchen
=*
opening_hours:lifeguard
=*
opening_hours:office
=*
opening_hours:pharmacy
=*
opening_hours:reception
=*
opening_hours:store
=*
opening_hours:workshop
=*
opening_hours:self_service
=*
collection_times
=*
– The collection times of a post box or recycling container
service_times
=*
– The times of a special service at a feature which is different than the opening hours, e.g, a religious service
breakfast
=*
– If and when breakfast is served
lunch
=*
– If and when lunch is served
lunch:buffet
=*
– When a lunch buffet is served
lunch:menu
=*
– When a lunch menu is served
dinner
=*
– If and when dinner is served
happy_hours
=*
– Time when a place offers discounts on alcoholic drinks
smoking_hours
=*
– Smoking is permitted within in a defined time range only
Conditional restrictions
also re-use the opening hours syntax to specify date- and time-based conditions.
If a location is closed permanently, then delete such object if it fully gone without risk of being remapped. If there are remains present you can use a tag with a
lifecycle prefix
such as
disused:*
=*
or
abandoned:*
=*
See also
JOSM/Plugins/OpeningHoursEditor
– A graphical editor for the opening_hours tag
Relevant Sophox queries:
Proportion of eateries open on Sundays
Southern Baptist church services by day of the week
External links
Online tools:
Openingh.openstreetmap.de
– Tool for checking and evaluating opening_hours tags
YoHours
– Online editor for the tag syntax. It doesn't support.advanced features of the syntax.
WebToOSMOH
– Online converter of free-form text to opening_hours syntax
OSM Open
– Find POIs that are open at a specific point in time
Parser libraries:
goodudetheboy/OpeningHoursEvaluator
GitHub
– Java
opening-hours/opening_hours.js
GitHub
– JavaScript/Node.js (
accepts holiday information
opening-hours/pyopening_hours
GitHub
– Python (
not maintained
remi-dupre/opening-hours-rs
GitHub
– Rust
with bindings for Python
rezemika/humanized_opening_hours
GitHub
– Python (not maintained)
ubahnverleih/simple-opening-hours
GitHub
– JavaScript
ujamii/osm-opening-hours
GitHub
– PHP
westnordost/osm-opening-hours
GitHub
– Kotlin Multiplatform
Validator libraries:
rezemika/oh_sanitizer
GitHub
– Python
Converter libraries:
anct-cartographie-nationale/timetable-to-osm-opening-hours
GitHub
– TypeScript
Editor libraries:
bryceco/OpeningHours
GitHub
– SwiftUI
marvinschopf/react-hours
GitHub
– React
simialbi/jquery-yohours
GitHub
– jQuery
simonpoole/OpeningHoursFragment
GitHub
– Android
References
1.0
1.1
1.2
1.3
YoHours doesn't support.advanced features of the syntax.
2.0
2.1
The default holidays can be added to
opening_hours.js
. There is an alternative system for default values which is currently not evaluated by
opening_hours.js
Default
is a proposal for a default values system. This proposal can set default values such as maxspeed for areas (countries, states, etc.), but also holidays periods. A country, a
zone
area can subscribe to a
default
containing such holidays definitions.
Retrieved from "
Categories
Key descriptions for group "properties"
Key descriptions
Key descriptions with status "approved"
Properties
Tagging Mistakes
Time data standards
Tag value is a list
Hidden categories:
Pages unavailable in Dutch
Item with no description in language FI
Item with no description in language ZH-HANS
Navigation menu