Valid calendar dates
What makes a calendar date valid, why forms say "please enter a valid date," and how reversal, mirroring and Unicode styling break date extraction.
A calendar date is valid when it names a day that actually exists in the calendar being used. When dates are pulled out of text, validity has two layers. First, the characters must be recognizable as a date. Second, the values must form a real day. Text transformations such as reversal, mirrored lettering or decorative Unicode "fonts" can break the first layer even when the date still looks correct on screen. This review explains both layers and helps you judge whether a transformed date will still work where you need it.
What makes a calendar date valid
In the Gregorian calendar used for most US dates, the month must be from 1 to 12. The day must be from 1 to the length of that month. April, June, September and November have 30 days. February has 28 days, or 29 in a leap year. All other months have 31. A date such as February 30 or April 31 is well formed but invalid, because that day does not exist.
- Leap year rule in the Gregorian calendar:
- A year divisible by 4 is a leap year.
- A year divisible by 100 is not a leap year, unless it is also divisible by 400.
- So 2024 and 2000 are leap years, 1900 and 2100 are not, and February 29 is valid only in leap years.
Format adds a separate problem. US convention writes month first (MM/DD/YYYY), so 03/04/2026 means March 4. Many other regions read the same string as 3 April. Both readings are valid dates, so a validity check cannot catch the misreading. The ISO 8601 form, YYYY-MM-DD, removes this ambiguity and is the safest choice for anything that will be parsed. Two-digit years need an explicit rule for which century they belong to. Software also has its own limits; for example, Python's date type accepts only years 1 through 9999. In practice, "valid" often means "valid for this system," not just "exists in the calendar."
Why a form says "please enter a valid date"
- Common causes of this kind of validation message:
- The day does not exist, such as February 29 in a non-leap year.
- The input does not match the format the field expects, for example day-first in a month-first field.
- The value falls outside a range the site allows, such as a past date in a booking form.
- The pasted text contains characters that look like digits but are not, such as styled Unicode digits.
- The pasted text carries invisible characters, such as zero-width spaces or bidirectional control marks, picked up from another document or web page.
For HTML date inputs, the browser chooses the displayed format, usually based on locale. The HTML standard defines the submitted value as YYYY-MM-DD regardless of how it is shown. The exact wording of the error message varies by browser and by site; this article does not verify the wording for any specific browser.
Is a transformed date suitable for your use?
Recommendation: if a date will be parsed, validated, searched, sorted, imported into a calendar or typed into a form, keep it as plain text with ordinary ASCII digits in an unambiguous format, preferably YYYY-MM-DD. The benefit of a transformation is purely visual, such as a stylized date in a social media bio or a decorative heading. The decisive tradeoff is that most transformations change the stored characters, and that breaks machine reading and can confuse assistive technology. A transformed date is reasonable only for decorative display where nothing needs to read it as a date, and only when a plain-text version is also present. In every other case, plain text is preferable.
What each transformation actually changes
The key distinction is between changing stored characters and changing only presentation. Stored changes travel with the text when it is copied, saved or submitted. Presentation-only changes affect how text looks in one place and disappear when the underlying text is copied. The terms are also used loosely. "Reverse" can mean reversing characters or reversing word order. "Mirror" can mean a visual flip applied by styling, or substituting lookalike characters. "Font" in online text generators usually does not mean a font at all. It means swapping ordinary characters for different Unicode characters that resemble styled letters and digits.
| Transformation | What changes | Effect on date extraction |
| Character reversal | Stored character order | Digits are reordered; the result is usually an invalid or different date |
| Word reversal | Stored token order | Digits stay intact, but the expected order is lost; parser results vary |
| Unicode "font" digits | Stored code points | Looks like digits; many parsers and searches do not treat them as digits |
| Mirrored or upside-down text | Stored characters replaced with lookalikes | Some digits become letters or symbols; the date is generally unrecoverable |
| Bidirectional control marks | Invisible stored characters added | Display order and stored order can differ; extraction reads stored order |
| CSS flip or direction styling | Presentation only | Stored text is unchanged; copying returns the original date |
Input: 2026-03-14
Character reversal: 41-30-6202
Input: March 14, 2026
Word reversal: 2026 14, March
In the character reversal example above, the ten characters are written back to front. The result would read as day 41, month 30, which is invalid in any order, and the year becomes 6202. Word reversal keeps each token intact ("March", "14," and "2026"), but the comma now follows the day in an unusual position. Whether a given parser accepts that order is not tested here. Neither example contains combining marks or emoji. If a date uses keycap emoji digits, each one is a sequence of several code points: a digit, a variation selector and a combining keycap mark. Naive character reversal splits those sequences apart and corrupts the display, not just the order.
Unicode substitution swaps digits for characters such as mathematical bold or fullwidth digits. They look like 0 to 9 but are different code points. Parsers differ in how they handle them. Some regular expression engines match only ASCII 0 to 9 as digits, while others treat any Unicode decimal digit as a digit. Do not assume either behavior without checking the specific tool. Mirrored and upside-down generators work by substitution too, but they often use letters or symbols that only resemble a flipped digit, for example a Latin open E standing in for a reversed 3. Those characters are not digits, so no general cleanup step reliably restores the date.
Bidirectional display is the subtlest case. Invisible control characters, such as the right-to-left override, can make text display in a different order than it is stored. A date can look correct on screen while its stored characters are in another order, or look reversed while stored correctly. Extraction tools read the stored order, so what you see may not be what gets parsed. CSS effects, such as a horizontal flip or a right-to-left direction setting, change only how a page renders. The stored text, and any copy of it, keeps the original characters.
Will the date stay readable and usable after copying or sharing?
Copying carries the stored characters, so reversed text, substituted digits, lookalike characters and invisible bidirectional marks all go wherever you paste. Presentation-only styling does not. This is why a date copied from a decorative page can fail a form check even though it looked fine. Some destinations may also render substituted characters as empty boxes if the device lacks a font that covers them. That depends on the device and app, and it has not been tested here for any named destination.
Screen readers read the stored characters, not the visual effect. A character-reversed date will be read in the reversed order. Styled Unicode digits may be announced differently from ordinary digits, depending on the screen reader and its settings. No screen reader testing was done for this article, so treat transformed dates as a risk for listeners and provide the plain version.
Search and editing are affected the same way. A search for 2026 will not match mathematical bold digits unless the search system normalizes them first. Spreadsheets and calendar imports may treat such values as plain text rather than dates, which breaks sorting and date arithmetic. Editing reversed or mixed-direction text is awkward because the cursor follows stored order, which may not match what you see.
A plain-text equivalent is needed whenever the date must be entered into a form, imported into a calendar or spreadsheet, found by search, read aloud by assistive technology or compared with other dates. When a styled date is used for display, place the plain date alongside it, or use CSS styling so the stored text stays unchanged.
Cleaning extracted dates before validation
When you extract dates from text you did not write, normalize the text before checking validity. Unicode NFKC normalization converts compatibility characters, including fullwidth and mathematical styled digits, back to ordinary digits. Invisible direction and zero-width characters should be removed separately, because normalization does not strip them. Then confirm the values form a real day. The Python sketch below follows that order for ISO-format dates.
import re
import unicodedata
from datetime import date
INVISIBLE_CONTROLS = dict.fromkeys(map(ord, "\u200b\u200e\u200f\u202a\u202b\u202c\u202d\u202e\u2066\u2067\u2068\u2069\ufeff"))
ISO_DATE = re.compile(r"(\d{4})-(\d{2})-(\d{2})", re.ASCII)
def extract_iso_date(text):
cleaned = unicodedata.normalize("NFKC", text).translate(INVISIBLE_CONTROLS)
match = ISO_DATE.search(cleaned)
if not match:
return None
year, month, day = map(int, match.groups())
try:
return date(year, month, day)
except ValueError:
return None
This approach recovers styled and fullwidth digits and removes hidden marks. It also rejects impossible dates such as February 30, because the date constructor raises an error. It does not repair character reversal or mirrored lookalike characters, and it does not settle month-first versus day-first ambiguity in other formats. Those cases need either the original plain text or a human check.
Evidence limits
No specific date extraction tool, browser, form, messaging app or screen reader was tested for this article, and no measurements are reported. The calendar rules come from the Gregorian calendar. The character behavior comes from Unicode and standard definitions. Statements about how particular destinations or assistive technologies handle transformed dates are deliberately left general. If a workflow depends on a specific destination, test it there with both the plain and the transformed date before relying on it.