# Japanese Imperial Year (Long/Kanji)

Key: `datetime.date.jp_era_long`

Full Japanese era name in kanji followed by year, month, day with Chinese-style character delimiters. Used in formal Japanese government and legal documents.

Page: <https://meridian.online/docs/finetype/types/datetime/date/jp_era_long>

Samples: `令和6年1月15日`, `平成31年4月30日`, `昭和64年1月7日`

## Use it

Shell

```shell
finetype infer -i '令和6年1月15日' --mode column
# → datetime.date.jp_era_long
```

DuckDB

```sql
SELECT ft_infer('令和6年1月15日');
-- → 'datetime.date.jp_era_long'
```

Cast template: {col} is your column

```sql
CASE
  WHEN {col} LIKE '令和%' THEN make_date(2018 + CAST(regexp_extract({col}, '(\d+)年', 1) AS INT), CAST(regexp_extract({col}, '(\d+)月', 1) AS INT), CAST(regexp_extract({col}, '(\d+)日', 1) AS INT))
  WHEN {col} LIKE '平成%' THEN make_date(1988 + CAST(regexp_extract({col}, '(\d+)年', 1) AS INT), CAST(regexp_extract({col}, '(\d+)月', 1) AS INT), CAST(regexp_extract({col}, '(\d+)日', 1) AS INT))
  WHEN {col} LIKE '昭和%' THEN make_date(1925 + CAST(regexp_extract({col}, '(\d+)年', 1) AS INT), CAST(regexp_extract({col}, '(\d+)月', 1) AS INT), CAST(regexp_extract({col}, '(\d+)日', 1) AS INT))
  WHEN {col} LIKE '大正%' THEN make_date(1911 + CAST(regexp_extract({col}, '(\d+)年', 1) AS INT), CAST(regexp_extract({col}, '(\d+)月', 1) AS INT), CAST(regexp_extract({col}, '(\d+)日', 1) AS INT))
  WHEN {col} LIKE '明治%' THEN make_date(1867 + CAST(regexp_extract({col}, '(\d+)年', 1) AS INT), CAST(regexp_extract({col}, '(\d+)月', 1) AS INT), CAST(regexp_extract({col}, '(\d+)日', 1) AS INT))
END

```

## Background

### Origin

Japan's Era Name Law, 元号法, is Law No. 43 of Showa 54 (昭和五十四年法律第四十三号).[[1]](https://laws.e-gov.go.jp/api/1/lawdata/354AC0000000043) The Era Name Law became law in 1979.[[2]](https://en.wikipedia.org/wiki/Japanese_era_name) The Era Name Law provides that era names are set by Cabinet Order (元号は、政令で定める。).[[1]](https://laws.e-gov.go.jp/api/1/lawdata/354AC0000000043) The Era Name Law provides that an era name is changed only when there is a succession to the imperial throne (元号は、皇位の継承があつた場合に限り改める。).[[1]](https://laws.e-gov.go.jp/api/1/lawdata/354AC0000000043) The Cabinet Order that changed the era to Reiwa, 元号を改める政令, was made under the first paragraph of the Era Name Law.[[3]](https://laws.e-gov.go.jp/api/1/lawdata/431CO0000000143) The Reiwa era began on 1 May 2019, the day of Naruhito's accession to the throne.[[2]](https://en.wikipedia.org/wiki/Japanese_era_name)

Microsoft's .NET documentation describes the Japanese calendar, also known as the Wareki calendar, as working exactly like the Gregorian calendar except that the year and era are different.[[4]](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.japanesecalendar) Java's documentation says the Japanese Imperial calendar system is the same as the ISO calendar system apart from the era-based year numbering.[[5]](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/chrono/JapaneseChronology.html) The .NET JapaneseCalendar class numbers five eras: 明治 (Meiji), 大正 (Taisho), 昭和 (Showa), 平成 (Heisei) and 令和 (Reiwa).[[4]](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.japanesecalendar) Microsoft's .NET documentation gives the Showa era as running from December 25, 1926 to January 7, 1989.[[4]](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.japanesecalendar) Microsoft's .NET documentation gives the Heisei era as running from January 8, 1989 to April 30, 2019.[[4]](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.japanesecalendar) Java's documentation maps 7 January Showa 64 to ISO 1989-01-07 and 8 January Heisei 1 to ISO 1989-01-08.[[5]](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/chrono/JapaneseChronology.html) The Japanese imperial year increments on January 1, just like the Gregorian year, not on the anniversary of the emperor's enthronement.[[6]](https://en.wikipedia.org/wiki/Date_and_time_notation_in_Japan)

### Use

Japanese government offices usually require era names and years for official papers.[[2]](https://en.wikipedia.org/wiki/Japanese_era_name) Much domestic and regional government paperwork in Japan retains the Japanese year.[[6]](https://en.wikipedia.org/wiki/Date_and_time_notation_in_Japan)

Microsoft's .NET blog warns that you can't be certain that a future date will always belong to the current era.[[7]](https://devblogs.microsoft.com/dotnet/handling-a-new-era-in-the-japanese-calendar-in-net/) Microsoft's .NET documentation says a change of era affects all applications that use its Japanese calendars.[[4]](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.japanesecalendar) The .NET blog notes that, with strict era range checking, future dates that are valid before an era change may become invalid after the era change.[[7]](https://devblogs.microsoft.com/dotnet/handling-a-new-era-in-the-japanese-calendar-in-net/) The .NET blog advises always formatting a date value with its era, because dates can be ambiguous.[[7]](https://devblogs.microsoft.com/dotnet/handling-a-new-era-in-the-japanese-calendar-in-net/) When a year runs past the end of its era, ask whether the date was written before the era changed before you treat it as an error. (Meridian's view) Convert these dates to ISO 8601 as early as you can, mapping each era name to its own Gregorian offset, and keep the original string beside the converted date. (Meridian's view)

### Where you'll meet it

Japan's Digital Agency dates the file releases on its page of local-government open-data survey results in era form with the Gregorian year in brackets, as in 令和7年（2025年）2月10日公開.[[8]](https://www.digital.go.jp/resources/data_questionnaire/)

## Sources

1. [元号法](https://laws.e-gov.go.jp/api/1/lawdata/354AC0000000043) — standard
2. [Japanese era name - Wikipedia](https://en.wikipedia.org/wiki/Japanese_era_name) — secondary source
3. [元号を改める政令](https://laws.e-gov.go.jp/api/1/lawdata/431CO0000000143) — standard
4. [JapaneseCalendar Class (System.Globalization) \| Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.japanesecalendar) — documentation
5. [JapaneseChronology (Java SE 21 \& JDK 21)](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/chrono/JapaneseChronology.html) — documentation
6. [Date and time notation in Japan - Wikipedia](https://en.wikipedia.org/wiki/Date_and_time_notation_in_Japan) — secondary source
7. [Handling a new era in the Japanese calendar in .NET - .NET Blog](https://devblogs.microsoft.com/dotnet/handling-a-new-era-in-the-japanese-calendar-in-net/) — documentation
8. [地方公共団体へのオープンデータの取組に関するアンケート結果・回答一覧｜デジタル庁](https://www.digital.go.jp/resources/data_questionnaire/) — organisation

## How it's detected

Formal Japanese imperial year with kanji era names. Transform maps era names to gregorian year offsets.
