Spec 0.16.0
Malagasy dates: rules and sources
Writes Gregorian dates in Malagasy, reads them back, says the time of day in words, and gives the Malagasy names of months and weekdays.
-
Input is a calendar date, never a time:
- text in ISO 8601 form
YYYY-MM-DD(2026-11-23); the month and the day may have one digit (2026-1-5). Text from a database or an API may carry a time after aTor a space (2026-11-23T14:30,2026-11-23 14:30:45): the time is ignored here, only the date is read. With a time zone (Z,+03:00,-05:00) the text is an instant and the date is the one in Madagascar (rule 10):2026-11-23T22:30:00Zis 24 November. A zone with no time (2026-11-23Z) isINVALID_FORMAT; or - calendar fields
{ year, month, day }; ports may also accept their native date type (JavaScriptDate, read in its local calendar fields; PHPDateTimeInterface).
- text in ISO 8601 form
-
Years 1 to 9999. Other years are
OUT_OF_RANGE. -
Impossible dates (
2026-02-30,2023-02-29):INVALID_FORMATfor text,OUT_OF_RANGEfor calendar fields. Text in any other shape (26/06/1960) isINVALID_FORMAT. Anything else isINVALID_TYPE. -
Styles (
formatDate), defaultlong:Style Pattern 2026-11-23longd MMMM y23 Novambra 2026fullEEEE d MMMM yAlatsinainy 23 Novambra 2026mediumy MMM d2026 Nov 23shorty-MM-dd2026-11-23numericdd/MM/y23/11/2026Pattern letters:
EEEEweekday name,dday,ddtwo-digit day,MMMMmonth name,MMMabbreviated month,MMtwo-digit month,yyear. Any other style isINVALID_TYPE. -
Reading dates (
parseDate): any style of rule 4, so every dateformatDatewrites reads back:23 Novambra 2026,23/11/2026→{ year: 2026, month: 11, day: 23 }. Case and spacing do not matter, and day and month may have one digit (5/7/2026). In thenumericstyle the separator may be/,-or.:23/11/2026,23-11/2026,23.11.2026all read the same (the separators of one date need not match). Afulldate must name its own weekday. A day that does not exist isINVALID_FORMAT, a year outside 1–9999OUT_OF_RANGE, text over 64 charactersINVALID_FORMAT. With astyle, only that style is read. Without one, the styles are tried in the order of rule 4 (long,full,medium,short,numeric) and the first that reads the text wins:5 Mey 12is 5 May of year 12 (long), not 12 May of year 5 (medium). Only years up to 31 can read two ways; pass the style to read another one. -
Names. Months 1–12, weekdays numbered as in ISO 8601 (Monday 1 … Sunday 7). Width
wide(default) orabbreviated; other widths areINVALID_TYPE, other numbersOUT_OF_RANGE.
| # | Month | Abbr. | ISO | Weekday | Abbr. | |
|---|---|---|---|---|---|---|
| 1 | Janoary | Jan | 1 | Alatsinainy | Alats | |
| 2 | Febroary | Feb | 2 | Talata | Tal | |
| 3 | Martsa | Mar | 3 | Alarobia | Alar | |
| 4 | Aprily | Apr | 4 | Alakamisy | Alak | |
| 5 | Mey | Mey | 5 | Zoma | Zom | |
| 6 | Jona | Jon | 6 | Asabotsy | Asab | |
| 7 | Jolay | Jol | 7 | Alahady | Alah | |
| 8 | Aogositra | Aog | ||||
| 9 | Septambra | Sep | ||||
| 10 | Oktobra | Okt | ||||
| 11 | Novambra | Nov | ||||
| 12 | Desambra | Des |
Telling the time
Section titled “Telling the time”Rule 7. Time (spellTime): amin'ny, the hour on a 12-hour clock in words and ora
(hour), then sy, the minutes in words (rule 3 of number-words) and minitra, then the part of
the day: 14:30 → amin'ny roa ora sy telopolo minitra tolakandro. On the hour only ora and
the part of the day follow the hour: 14:00 → amin'ny roa ora tolakandro. Every minute is counted; there are no fractions (quarter,
third, half) and no counting down to the next hour. Input is text, { hour, minute }, or a
port’s native time. Text is H:MM or HH:MM (00:00 to 23:59), with optional seconds
(14:30:45), or the Malagasy and French way with an h: 9h30, 14h (case does not
matter). Seconds are dropped, never rounded: 14:30:59 is said as 14:30. A time zone
after the time (14:30Z, 14:30+03:00) makes it an instant, said in Madagascar time (rule 10).
Other text is
INVALID_FORMAT, an hour outside 0–23 or a minute outside 0–59 OUT_OF_RANGE.
| Time | Words |
|---|---|
| 02:00 | amin'ny roa ora alina |
| 02:01 | amin'ny roa ora sy iray minitra alina |
| 07:15 | amin'ny fito ora sy dimy ambin'ny folo minitra maraina |
| 14:30 | amin'ny roa ora sy telopolo minitra tolakandro |
| 17:45 | amin'ny dimy ora sy dimy amby efapolo minitra tolakandro |
Parts of the day, by the hour: alina 0–3 and 20–23, maraina 4–11, atoandro 12,
tolakandro 13–17, hariva 18–19. Noon and midnight are counted like other hours (roa ambin'ny folo): 00:00 → amin'ny roa ambin'ny folo ora alina.
Rule 8. Reading the time (parseTime): the words spellTime says, in any case and spacing,
with or without amin'ny, back to { hour, minute }. Every time of day has its own words.
Anything else (no part of the day, other words, the older forms with sasany, fahefany or
latsaka, text over 128 characters) is INVALID_FORMAT.
Rule 9. Date and time (spellDateTime): the date in a style of rule 4 (default long),
then the time in words of rule 7, joined as CLDR joins them ({date} {time}):
2026-11-23T14:30 → 23 Novambra 2026 amin'ny roa ora sy telopolo minitra tolakandro. Input is
text of a date of rule 1 and a time of rule 7 (2026-11-23T14:30, 2026-11-23 14:30:45; a
space may replace the T; a time zone makes it an instant read in Madagascar time, rule 10),
{ year, month, day, hour, minute },
or a port’s native date and time. The date and the time follow their own rules and errors.
Rule 10. Time zones. Text with a zone after the time (Z, +HH, +HH:MM, +HHMM, with +
or -; hours 00–23, minutes 00–59) is an instant, and it is read in Madagascar time, UTC+3
all year, with no daylight saving. The date and the time are those of Madagascar at that
instant, so the day can change: 2026-11-23T22:30:00Z is 24 November, 01:30. +03:00 changes
nothing. A zone outside the allowed hours and minutes is INVALID_FORMAT. A native date or
time (JavaScript Date, PHP DateTimeInterface) is read in its own local fields, as before.
Rule 11. Timestamps. A whole number from epoch.minMilliseconds (1 000 000 000 000, 9
September 2001) to epoch.maxMilliseconds (7 258 118 400 000, 1 January 2200) is Unix time in
milliseconds and is read in Madagascar time (rule 10): the number of Date.now() in JavaScript.
1764000000000 is 24 November 2025, 19:00. Any other number is INVALID_TYPE, because it is
probably Unix seconds (multiply by 1000) or a number such as 20261123 or 202611231430, and
the library never guesses; a number with decimals is INVALID_TYPE too. This applies to
formatDate, spellTime and spellDateTime.
Rule 12. Reading a date and time (parseDateTime, safeParseDateTime, tryParseDateTime):
what spellDateTime writes, in any style of rule 4, back to { year, month, day, hour, minute }.
The date comes first and the time, with its amin'ny, last: 23 Novambra 2026 amin'ny roa ora sy telopolo minitra tolakandro. Both parts follow rules 5 and 8, and their errors; text with no
time, or no amin'ny, is INVALID_FORMAT. With a style, only that style is read.
Text input of dates and times ignores spaces before and after the text (a pasted value).
Sources
Section titled “Sources”-
Clock time: Malagasy-English/English-Malagasy Dictionary and Phrasebook (J. Rasoloson, Hippocrene), as quoted by Wild Madagascar:
Amin'ny roa(2:00),sy dimy(2:05),sy sasany(2:30),Amin'ny telo latsaka fahefany(2:45),latsaka dimy(2:55). Dictionary entries maraina (Amin' ny folo maraina) and hariva (Amin' ny dimy hariva). Parts of the day: Peace Corps Madagascar, Malagasy Language Lessons. -
Month and weekday names, abbreviations, and the
long,full,mediumandshortpatterns: Unicode CLDR 49, localemg, ca-gregorian.json. -
Cross-checked with the Malagasy Dictionary: Janoary, Alatsinainy (“andro faharoa amin’ny herinandro”, second day of the week), Alahady (“andro voalohany amin’ny herinandro”, first day of the week).
Recorded disagreements
Section titled “Recorded disagreements”- Minutes. The phrasebook (Rasoloson) uses fractions and counts down to the next hour:
sy sasany(2:30),telo latsaka fahefany(2:45). The spec counts every minute (sy telopolo minitra,sy dimy amby efapolo minitra), as the project lead decided on 2026-11-29 (rule 7).
Recorded decisions
Section titled “Recorded decisions”-
Forgiving input (rules 1, 5, 7, 9, 10). On 2026-12-02 the project lead asked that developers need no cleanup code before calling the library: dates and times as databases and APIs write them are read directly (one-digit month and day, a time after a date, seconds,
9h30,-and.in numeric dates). Seconds are dropped and never rounded. Text with a time zone is an instant read in Madagascar time (UTC+3, fixed, no daylight saving), so atoISOString()value needs no conversion. -
Timestamps (rule 11). On 2026-12-02 the project lead asked for
formatDate(Date.now())to work. Only whole numbers between 2001 and 2200 are read, as milliseconds: seconds and date numbers such as202611231430are not guessed. -
Minutes and parts of the day (rule 7). The source gives
amin'nyand the hour. On 2026-11-29 the project lead set the rest, replacing the decision of 2026-11-27: every minute is counted assy+ the number +minitra(nofahefany,fahatelony,sasany,latsakaormahery), nothing on the hour, the parts of the dayalina0–3 and 20–23,maraina4–11,atoandro12,tolakandro13–17,hariva18–19, and noon and midnight counted asroa ambin'ny folo.parseTimereads only this spelling. On 2026-12-02 the project lead addedora(hour) after the hour (5h30isamin'ny dimy ora sy telopolo minitra maraina);parseTimereads only this spelling. -
numericstyledd/MM/y. CLDRmghas no such pattern (itsshortisy-MM-dd). The project lead asked (2026-11-24) for both: CLDR by default, anddd/MM/yas an option because it is the everyday written form in Madagascar. -
ISO weekday numbers. The dictionary counts Sunday (Alahady) as the first day of the week; the spec numbers weekdays as ISO 8601 (Monday 1) so every language maps them the same way. Names are unaffected.