According to
this article (
Google Translate) in the official bulletin of the German Publishers & Booksellers Association, ebooks "harmful to minors" must only be sold between 10 p.m. and 6 a.m.
Although originally created for movies and television, this law also applies to ebooks, explains in-house counsel Christian Sprang, adding that they are currently looking for a way to avoid having to check each book manually by the bookseller. The most likely solution would involve a special mandatory field in publishers' catalogs, and/or restricting certain books to special parts of online retailers' websites which can then be hidden by filtering software.
But for now, booksellers beware: you're breaking German law if you're peddling your smut during the (German) day ...