Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert Japanese era to western date

100 views
Skip to first unread message

Ben Bullock

unread,
Jul 25, 2012, 4:43:11 AM7/25/12
to
The following newly-remade web pages

http://www.sljfaq.org/cgi/date.cgi

and

http://www.sljfaq.org/cgi/date_ja.cgi

now do Japanese era -> western conversions, for example,

http://www.sljfaq.org/cgi/date.cgi?year=showa+1

gives you "showa 1", or

http://www.sljfaq.org/cgi/date.cgi?year=%E3%81%9F%E3%81%84%E3%81%97%E3%82%87%E3%81%86%EF%BC%91%EF%BC%90

gives the Japanese version of 1921.

If anyone would like to try them out I would be grateful for feedback.

Some things remaining to do are to include the southern eras and to
include kanji numerals. This also does not deal with the date of era
changes yet.

chance

unread,
Jul 25, 2012, 11:20:13 AM7/25/12
to

"Ben Bullock" <benkasmi...@gmail.com> wrote
in message
news:2a025250-562e-44de...@po9g2000pbb.googlegroups.com...
> The following newly-remade web pages
>
> http://www.sljfaq.org/cgi/date.cgi
>
> and
>
> http://www.sljfaq.org/cgi/date_ja.cgi
>
> now do Japanese era -> western conversions, for example,
>
> http://www.sljfaq.org/cgi/date.cgi?year=showa+1
>
> gives you "showa 1", or
>
> http://www.sljfaq.org/cgi/date.cgi?year=%E3%81%9F%E3%81%84%E3%81%97%E3%82%87%E3%81%86%EF%BC%91%EF%BC%90
>
> gives the Japanese version of 1921.
>
> If anyone would like to try them out I would be grateful for
> feedback.
>

An ingenious device. Incidentally, Ben Bullock is aka Ben Monroe?

Ben Bullock

unread,
Jul 25, 2012, 5:41:35 PM7/25/12
to
On Jul 26, 12:20 am, "chance" <cinci...@yahoo.co.kr> wrote:
> "Ben Bullock" <benkasminbull...@gmail.com> wrote
> in messagenews:2a025250-562e-44de...@po9g2000pbb.googlegroups.com...
>
>
>
>
>
>
>
>
>
> > The following newly-remade web pages
>
> >http://www.sljfaq.org/cgi/date.cgi
>
> > and
>
> >http://www.sljfaq.org/cgi/date_ja.cgi
>
> > now do Japanese era -> western conversions, for example,
>
> >http://www.sljfaq.org/cgi/date.cgi?year=showa+1
>
> > gives you "showa 1", or
>
> >http://www.sljfaq.org/cgi/date.cgi?year=%E3%81%9F%E3%81%84%E3%81%97%E...
>
> > gives the Japanese version of 1921.
>
> > If anyone would like to try them out I would be grateful for
> > feedback.
>
> An ingenious device. Incidentally, Ben Bullock is aka Ben Monroe?

No, but we have so much in common (four letters, three in the same
order) that it's not surprising you get confused.

Tad Perry

unread,
Jul 27, 2012, 7:56:35 AM7/27/12
to
1989 is partially both Showa 64 and Heisei 1.

I see that Showa 64 is not recognized at all, but Heisei 1 gives 1989, so I
assume that however a year ended is how the entire year is treated.

The absolute easiest, most minimalistic way to handle this would be to add
the date an era started and ended using the Western Calendar every time that
era is named in parentheses. (In the front is easiest.)
That may not be the best ultimate solution, but for the time being it would
take no extra coding, just adding it to the string already being used.

Entering 1989 would then return:

(1989/1/8 to Present) Heisei 1

Everyone could then infer that the era given for the previous year plus one
covers 1989/1/1 through 1989/1/7.

A more elegant solution could be worked on later, but this actually gives
additional valuable information as many people looking up a given year might
wonder when the era they encounter started and ended. This would tell them,
saving them an additional Google search.

tvp

Ben Bullock

unread,
Jul 27, 2012, 8:52:41 PM7/27/12
to
On Jul 27, 8:56 pm, "Tad Perry" <tadpe...@comcast.net> wrote:

>
> 1989 is partially both Showa 64 and Heisei 1.
>
> I see that Showa 64 is not recognized at all, but Heisei 1 gives 1989, so I
> assume that however a year ended is how the entire year is treated.

Yes, your comment is very astute. In fact the underlying data contains
the date of the change but this is not presented to the user. It
definitely should include this information.

> The absolute easiest, most minimalistic way to handle this would be to add
> the date an era started and ended using the Western Calendar every time that
> era is named in parentheses. (In the front is easiest.)
> That may not be the best ultimate solution, but for the time being it would
> take no extra coding, just adding it to the string already being used.
>
> Entering 1989 would then return:
>
> (1989/1/8 to Present) Heisei 1
>
> Everyone could then infer that the era given for the previous year plus one
> covers 1989/1/1 through 1989/1/7.

I don't know why you think this doesn't involve any extra coding!
Actually that date script is rather a gruesome thing. I had only just
started to learn Perl when I wrote it and I was still struggling a
lot, which really shows in the code. The J. era to Western year thing
is bolted on to the Frankenstein's monster.

> A more elegant solution could be worked on later, but this actually gives
> additional valuable information as many people looking up a given year might
> wonder when the era they encounter started and ended. This would tell them,
> saving them an additional Google search.

Thanks, what you said is entirely correct but a fatigue has set in to
this project. I will try to reinvigorate myself enough to add the
correct ending year and the date of the start of the era.

Tad Perry

unread,
Jul 27, 2012, 9:35:17 PM7/27/12
to
Ben Bullock wrote:
> On Jul 27, 8:56 pm, "Tad Perry" <tadpe...@comcast.net> wrote:
>
>>
>> 1989 is partially both Showa 64 and Heisei 1.
>>
>> I see that Showa 64 is not recognized at all, but Heisei 1 gives
>> 1989, so I assume that however a year ended is how the entire year
>> is treated.
>
> Yes, your comment is very astute. In fact the underlying data contains
> the date of the change but this is not presented to the user. It
> definitely should include this information.
>
>> The absolute easiest, most minimalistic way to handle this would be
>> to add the date an era started and ended using the Western Calendar
>> every time that era is named in parentheses. (In the front is
>> easiest.)
>> That may not be the best ultimate solution, but for the time being
>> it would take no extra coding, just adding it to the string already
>> being used.
>>
>> Entering 1989 would then return:
>>
>> (1989/1/8 to Present) Heisei 1
>>
>> Everyone could then infer that the era given for the previous year
>> plus one covers 1989/1/1 through 1989/1/7.
>
> I don't know why you think this doesn't involve any extra coding!

I was assuming that you could add the date to the beginning of the actual
string "Heisei," for example, and every time "Heisei" appears now "(1989/1/8
to Present) Heisei" would appear instead.

Am I wrong on that?

tvp

Ben Bullock

unread,
Jul 28, 2012, 3:32:30 AM7/28/12
to
On Fri, 27 Jul 2012 18:35:17 -0700, Tad Perry wrote:

> I was assuming that you could add the date to the beginning of the
> actual string "Heisei," for example, and every time "Heisei" appears now
> "(1989/1/8 to Present) Heisei" would appear instead.

It usually turns out a bit harder than expected.

I have implemented this suggestion along with some other things. There
are still some problems left with one or two things. Anybody who wants to
try please do so.


--
sci.lang.japan FAQ/language tools: http://www.sljfaq.org/afaq/

Ben Bullock

unread,
Jul 28, 2012, 3:20:07 AM7/28/12
to
On Jul 28, 10:35 am, "Tad Perry" <tadpe...@comcast.net> wrote:
why you think this doesn't involve any extra coding!
>
> I was assuming that you could add the date to the beginning of the actual
> string "Heisei," for example, and every time "Heisei" appears now "(1989/1/8
> to Present) Heisei" would appear instead.

Well, these things tend to be more difficult than expected.

I've implemented the suggestion you made about the end / start dates,
so if anyone would like to test it out that would be great.

The start / end dates are probably nonsense for anything pre-Meiji but
nevertheless they are produced.

chance

unread,
Jul 28, 2012, 4:34:51 AM7/28/12
to

"Ben Bullock" <benkasmi...@gmail.com> wrote in message
news:2543c415-48e3-440f...@f9g2000pbd.googlegroups.com...
Ben Monroe rearely if ever appears in this place.
Is anyone there who knows anything about him?

Thanks
CK

Bart Mathias

unread,
Jul 28, 2012, 10:10:14 PM7/28/12
to
My sci.lang.japan is kicking out things already read and I didn't have time to answer this, so I'm piecing it back together from Chance's reply.

"Ben Bullock" <benkasmi...@gmail.com> wrote
> The following newly-remade web pages
>http://www.sljfaq.org/cgi/date.cgi
> and
>http://www.sljfaq.org/cgi/date_ja.cgi
> now do Japanese era -> western conversions, for example,
>http://www.sljfaq.org/cgi/date.cgi?year=showa+1
> gives you "showa 1", or

Pretty nice. I was wondering how you would handle the fact that Japanese
years and Western years don't match until quite recently. I find it very
annoying when a Taiga Dorama, say, will have subtitles for something like
Entoku yonen nigatsu tooka as "February 10, 1492." Your program at least
hints that things aren't that simple when it shows stuff like

"1492 was year 1 of the Meio (明応) era, from 19 September 1492 to 25 April
1501, and year 4 of the Entoku (延徳) era, from 23 October 1489 to 18
September 1492."

But we're still out of luck if we want to know what day of what month Entoku
4/2/10 actually fell on.
--
Bart Mathias <mat...@hawaii.edu>

Ben Bullock

unread,
Jul 28, 2012, 11:07:02 PM7/28/12
to
On Sat, 28 Jul 2012 16:10:14 -1000, Bart Mathias wrote:


> Pretty nice. I was wondering how you would handle the fact that Japanese
> years and Western years don't match until quite recently. I find it very
> annoying when a Taiga Dorama, say, will have subtitles for something
> like Entoku yonen nigatsu tooka as "February 10, 1492." Your program at
> least hints that things aren't that simple when it shows stuff like
>
> "1492 was year 1 of the Meio (明応) era, from 19 September 1492 to 25
> April 1501, and year 4 of the Entoku (延徳) era, from 23 October 1489 to
> 18 September 1492."

The dates which are used are taken from a pre-existing library:

https://metacpan.org/module/DateTime::Calendar::Japanese::Era

> But we're still out of luck if we want to know what day of what month
> Entoku 4/2/10 actually fell on.

I believe that historical dates are very difficult even for Western
calendars. There is a library which does the lunar calendar calculations
for Japanese pre-Western dates, and I was hoping to use it in conjunction
with the above to provide such a service, but unfortunately it requires a
huge number of other libraries to be installed.

It probably would be wisest to remove the dates for pre-Meiji eras.

ueshiba

unread,
Jul 29, 2012, 2:06:08 AM7/29/12
to
2012年7月29日日曜日 11時10分14秒 UTC+9 Bart Mathias:
>
> "1492 was year 1 of the Meio (明応) era, from 19 September 1492
> to 25 April 1501,

なお、年号と西暦との変換に際し、注意を払わなければならないのは、
西欧においても、ユリウス暦からグレゴリオ暦に切り替わったことが
あった しかも、それが国々(特にプロテスタント系の国々)に関し
一致していない という点です。

すなわち、カソリック系の国々では、グレゴリオ13世の指示により、
(それまでのユリウス暦による)1582年10月4日の*翌日*を
(新しいグレゴリオ暦による)1582年10月15日とする、
つまり、1582年には10月5日から14日までは存在しない
という形で切り替えが行われました。(なお、曜日は連続させた)

カソリック系の国々、つまり、イタリア、フランス、スペイン、
ポルトガル、ポーランドといった国々ではただちにこれが採用され
ましたが(この暦に従って教会の行事を行う必要がある)
教義、あるいは、教会の行事を異にするプロテスタント系の国々では
グレゴリオ暦の採用が非常に遅れ、
イギリスでは1752年、ドイツは1775年、アメリカは1783年
にグレゴリオ暦への変更が行われました。
したがって、この間の200年ほどの間については、年末の10日ほど
に関し国によって西暦に違いが生じることになります。

序に言いますと、ギリシャ正教系の国々がグレゴリオ暦を採用したのは
もっともっとおそく、たとえばロシア(当時のソ連)が採用したのは
(革命後の)1918年になってからです。
                     上柴 公二

chance

unread,
Jul 29, 2012, 3:05:07 AM7/29/12
to

"ueshiba" <ues...@mtc.biglobe.ne.jp> wrote in message
news:4c88afe0-2d0b-4c3f...@googlegroups.com...
本件との離れ話しですがある人はその署名のしがたに
ちょっと’みにくい’ところがありまして、ひとごといわせもらえばと
おもいまして、どうして真中に’はたばいて’のかっこにしか
かけないのでしょうか。’いばっても’ほどがありますよ。


Bart Mathias

unread,
Jul 29, 2012, 10:35:15 PM7/29/12
to
On Sat, 28 Jul 2012 23:06:08 -0700 (PDT)
ueshiba <ues...@mtc.biglobe.ne.jp> wrote:

> 2012年7月29日日曜日 11時10分14秒 UTC+9 Bart Mathias:
> >
> > "1492 was year 1 of the Meio (明応) era, from 19 September 1492
> > to 25 April 1501,
>
> なお、年号と西暦との変換に際し、注意を払わなければならないのは、
> 西欧においても、ユリウス暦からグレゴリオ暦に切り替わったことが
> あった しかも、それが国々(特にプロテスタント系の国々)に関し
> 一致していない という点です。

Indeed. And that makes it impossible to really translate
early dates. Nor is there really a need to, unless an
astronomical event is involved, I would think. Or maybe
in some rare cases to match Jesuit records against Japanese.

Otherwise, who cares where Columbus might have been on
Entoku 4/2/10. Generally, "This all happened WAY before you
were born" should be all one need know.

> すなわち、カソリック系の国々では、グレゴリオ13世の指示により、
> (それまでのユリウス暦による)1582年10月4日の*翌日*を
> (新しいグレゴリオ暦による)1582年10月15日とする、
> つまり、1582年には10月5日から14日までは存在しない
> という形で切り替えが行われました。(なお、曜日は連続させた)
>
> カソリック系の国々、つまり、イタリア、フランス、スペイン、
> ポルトガル、ポーランドといった国々ではただちにこれが採用され
> ましたが(この暦に従って教会の行事を行う必要がある)
> 教義、あるいは、教会の行事を異にするプロテスタント系の国々では
> グレゴリオ暦の採用が非常に遅れ、
> イギリスでは1752年、ドイツは1775年、アメリカは1783年
> にグレゴリオ暦への変更が行われました。
> したがって、この間の200年ほどの間については、年末の10日ほど
> に関し国によって西暦に違いが生じることになります。
>
> 序に言いますと、ギリシャ正教系の国々がグレゴリオ暦を採用したのは
> もっともっとおそく、たとえばロシア(当時のソ連)が採用したのは
> (革命後の)1918年になってからです。
>                      上柴 公二

--
Bart Mathias <mat...@hawaii.edu>

chance

unread,
Jul 30, 2012, 7:13:36 AM7/30/12
to

"Bart Mathias" <mat...@hawaii.edu> wrote


> Entoku 4/2/10. Generally, "This all happened WAY before you
> were born" should be all one need know.

Agreed. I am being astounded at the stupidity of the Japanese
keeping counting years employing two systems,
one recording this year 2012 and on the other heisei 23.
Don't they feel galling to convert one from and to the other?
Good grief!



chance

unread,
Jul 30, 2012, 11:07:01 AM7/30/12
to

"chance" <cinc...@yahoo.co.kr> wrote in message
news:jv5q8m$nvf$1...@dont-email.me...
>
> "Bart Mathias" <mat...@hawaii.edu> wrote
>
>> Entoku 4/2/10. Generally, "This all happened WAY before you
>> were born" should be all one need know.
>
> Agreed. I am being astounded at the stupidity of the Japanese
> keeping counting years employing two systems,
> one recording this year 2012 and on the other heisei 23.
24 instead of 23.
0 new messages