Mapping opening hours correctly can be a pain; the format for the opening_hours key can be hard to remember. I didn't use to do it much for that reason. Until I recently discovered that there's a JOSM plugin for that! It works really well, let me show you how I added hours of a local restaurant in seconds.

First, of course, make sure you have the plugin installed:

Then, select the thing you want to add opening hours for:

And select 'Edit Opening Hours' from the Data menu (or use the keyboard shortcut).

If the plugin detects an existing opening_hours tag, it will offer to edit that, or you can create it. It will then offer a graphical interface for setting the hours:

You can move and drag blocks as you would expect. The plugin will parse it in the expected format. A nice little extra is that it supports the 'open end' hours in the format 17:00+ - useful for places that don't have a set closing hour but instead say 'open till late' or something similar.

Perhaps old news to y'all, but it made me happy :)

A Word Of Caution

Several people have pointed out (link is to the German forum) that the plugin is limited in what it can do. It will not cover most complex cases, like exceptions for public holidays and month to month variations) and does not seem to properly cover some of the simpler cases.

I still feel that it is good for a lot of basic opening hours tagging, but please review the opening_hours specification.

There is also a validator tool that I don't quite understand how to use, perhaps someone can explain in the comments?

Flo - yes they do look strange, I agree. I think the convention is to map this as Tu-Th 18:00-02:00 and the plugin will create two separate intervals instead. It's not really invalid, it's just not optimal, in my opinion.

put your (wrong) range in it, and it shows in most cases the right. Additionally you can select (some) date to check.

P.s. The tool is additionally integrated in the josm-validator; the contributor (ypid) answers (technical) Questions at most of the time in one day ... via PM in OSM or in GitHub and sometimes in the OSM-Forum.

Reading through the weekly news on the osm blog I noticed your blog post (nice one btw.). The OpeningHoursEditor plugin is a good tool if you encoutner simple opening hours and/or if you know it‘s limits as mentioned by MKnight (although I personally don‘t use it). If there is anything more complex I would encourage you to check out the evaluation_tool on which I spend quite some effort to make it powerful and error tolerant. You can check out the opening_hours value you used in this post on the evaluation tool if you like and try to edit the value and see the result. I can imagine that the tool is a bit overwhelming at first but I hope that it can be used intuitively after you know your way around with the thing. Also note that JOSM does use the same tool in the background for verification of the opening_hours value (meaning that the warnings you will see if the value is not correct are the same as given by the evaluation tool).
Feel free to ask if you have more questions about it.

The basic problem is that the grammar is just to complex. While it is nice that you can specify nearly everything it is riddled with special cases that make a complete implementation a pain. Further the available grammar spec seems to have errors (missing definition of ) and doesn't cover things that seem to be in use, like using "," as delimiters between rule-squences. WHich btw doesn't seem to be documented.

And then there is stuff like if you are reasonably lenient about what you accept, for example allowing naked hour values without ":", a legal spec like "11" becomes ambiguous.

@SimonPoole: I knew that the specification that you where probably referring to did (and still does) not yet cover everything which can be expressed as it was stated in the first sentence of the page: "This specification corresponds (not in every detail yet) to opening_hours.js"

I had this on my todo list for a while and finally did it yesterday.

While it is nice that you can specify nearly everything it is riddled with special cases that make a complete implementation a pain.

I get that but that‘s how reality is, right? (Better get used to it ;) ) If you want to cover all the tricky parts with such a syntax (and a software library which implements it) it is inevitable that it will get complected. If someone would reimplement a parser for this in a different language than I guess it could be done much quicker because there is already one implementation which covers it all. One ray of hope, you don’t have to use all the power if you don‘t need it. You will come pretty far with the basic stuff like Mo-Fr 12:00-18:00; Sa 12:00-17:00; We off

Further the available grammar spec seems to have errors (missing definition of ) and doesn't cover things that seem to be in use, like using "," as delimiters between rule-squences. WHich btw doesn't seem to be documented.

Netzwolf introduced them to the syntax but somehow forgot to add them to the specification. It is now covered.

And then there is stuff like if you are reasonably lenient about what you accept, for example allowing naked hour values without ":", a legal spec like "11" becomes ambiguous.

This was never part of the specification and never will be. It is just part of the error tolerance of opening_hours.js which I added to make fixing of values easier.
Note that only something like: 11-18 can be interpreted. (You may refer to the opening_hours bot which can do that but is not in use (at least by me) for now.)