Handling missing Effective Date

The Plone dexterity effective date is returns beginning of epoch [plone.dexterity/content.py at master · plone/plone.dexterity · GitHub] if the document is not published or private. Is there a good way to handle checking if effective date is set ? Thanks!

<span tal:replace="context/author"/>
            (<span
                 tal:replace="python:context.toLocalizedTime(context.effective())"
                 />).&nbsp;

context.effective() == FLOOR_DATE?

Of course, you need to import FLOOR_DATE. For use in a template, you may need to use security declarations to make this possible. For those cases, I have a module public with imports that should be available to restricted contexts and make its import possible with an allow_module("public").

Why don’t you use EffectiveDate()? This one returns either None or the effective_date set on the content. With effective() you get either the content’s effective_date or creation_date or FLOOR_DATE.

Thank you @dieter and @tmassman for great answers.