Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How pervasive is the Japanese calendar in computing actually? I suppose most programs calculate all dates internally using UNIX timestamps or UTC and only convert that to Japanese dates for display purposes. Anybody has any experience with this?


Yes, I have been doing software development in Japan for the past decade.

Of course you are right that no sane person would contemplate this calendar for any purpose other than user-facing display, and even then only where it is absolutely required.

But the insane WTF thing is that it does still seem to be widely required on any kind of financial document. Expense reports, salary statements, that kind of thing. All my banks use this format (and also SJIS text encoding when I download my data (T_T)...)

There are also lots of internal processes^W^W Excel spreadsheets in active use that expect these values so I've seen more than one program that converts 2013 to "H.25"... and it's literally impossible to represent a future date, since we don't know when the emperor might die, even if we have a projected abdication date.

I can't be too smug about it, since I'm American (miles and feet, anybody?) but it is... objectively non-optimal.


Interestingly, sometimes the system is used for future dates. For instance, my drivers license expires in September of H.31, which I guess will never happen now.


Does this imply that the driver's license becomes invalid and must be replaced with one in the new date system?

Real question


Or -- perhaps more intriguingly -- given that the date in question will never occur, is it valid until the end of time?

Philosophically it's a rather fun question, but practically they'll probably just honor it until the corresponding date of the new era.


It will stay valid. Consider having have to replace millions and millions right after the swap, it will be chaos. The system is simply stupid, not even citizens want it.


Canada isn't much better re: feet, miles. Things are officially metric, but because of proximity to the US and inertia, half of everything is still standard. Buying construction supplies and consumables? All in US units. People talk about square footage of condos, buy carpet in square feet, all fasteners are in US units. But gasoline is sold by the liter. People know how tall they are in feet and inches, not cm. Everything is mixed up together.


Interesting. UK is also weird: food is weighed in metric units, people in imperial; Drinks bought in supermarkets are measured in metric, pubs use imperial (by law in both cases, IIRC); Distances on signs can be meters or miles, both initialised as “m” (context being the only clue); fuel is sold by the litre, fuel efficiency is miles per gallon.


Beer and cider is sold in pubs in imperial pints (bigger than US pints), but wines and spirits are sold in milliliters.

See https://www.gov.uk/weights-measures-and-packaging-the-law


Good point, I’d forgotten wine and beer were different. I wonder what further examples of mixed up units the UK has?


Well there is a tendency to still use Fahrenheit during summer like "it's in the 80s", and "it's in the 90s" this month, but most use Celcius for winters when it gets below freezing. There must be a grey area in the 50s and 60s F. Both approaches often seen in headlines. :)


I'm a physicist and I still feel compelled to die on the following hill, re: Fahrenheit---it just maps better to human perception:

30s: Wear a heavy coat

40s: Wear a light coat

50s: Wear a jacket

60s: Wear a hoodie

70s: Wear a t-shirt

80s: Wear shorts


Works in C too:

-ve Don't go outside

0s Wear a coat

10s Wear a jacket

20s Wear a t-shirt

30s Don't go outside


-40s too cold

-30s cold

-20s February

-10s beanie optional

-0s can't store non-alcoholic drinks on the balcony

+0s wear waterproof boots

+10s no need to wear a jacket

+20s don't wear more than a t-shirt

+30s can't sleep since my apt. has no AC

Fixed that for northeners you insensitive clod.


What a brilliant comment! In fact, I'd even say it's over 9E+3 photons/s/mm^2/mrad^2/(0.001*Δλ)


c is just easy because 0 is the freezing point.


Miles per Imperial gallon.


don't some parts of Europe also use decilitres for beverage packaging? I've seen bottles that are like "75dl", and it took me a few minutes to clue in.


That would be centiliters, for example, wine is most commonly sold in 75cl bottles. Millilitres is also a common unit for smaller quantities in e.g. cosmetics.


Right! I actually meant centiliters - it's been a few years. But a commenter below mentions deciliters are a thing as well. What a crazy world :)


At least in some parts of central Europe it is common to buy beverages per decilitre and meat by dekagrams.


750 Liters would be a very large beverage! A typical keg of beer is only around 59 liters.


1dL = 0.1L


My bad, thought the d was for deca, not deci.

I'm in the US and although I spent some time in Canada I am for the most part not used to seeing the metric system used day to day. My metric system knowledge basically is what I remember from elementary and middle school.


Any movement to slowly unify the spreads?


but to further confuse things, your height on the driver's license is in cm, not ft-in. and while some imperial units are widely used, I've never heard anyone using yards or gallons, and very rarely miles. I find it rather adorable.


concrete pours are still priced by the cubic yard (such as if doing a radio tower foundation or any commercial project).

a lot of construction related things that are priced by the cubic volume are still in cubic yards.


Yeah

I suppose they like using lbs and sqft as $/lb is smaller and sqft is a bigger number than sqm (and of course the inertia which I prefer calling "being lazy")

It is definitely ridiculous


It's sad this date system is there for no reason today. Systems never like it and neither do people. I rarely use it and it's mostly bank related but every time I do, I look it up on Google to make sure I remember the number right. This needs to be dropped.


I don't think that's the problem; I think that's the one thing that's not a problem. Monotonic time is not that hard. The hardest thing about it is just convincing programmers to use it, and making sure your libraries use it properly. I don't want to say it's trivial, but it's not that hard once both you and your code base internalize "convert everything to internal UTC representation as quickly as possible, convert to local time as late as possible on the way out".

It's everything else that's a problem. It's the places where you input the Japanese time, and there's an era that the code has never heard of for some old system. There is no way for that system to even conceivably handle it without some sort of update, at least a database update. They're talking about creating a new character for the era, which literally no system on Earth can currently use because it doesn't even exist yet, and, again, anything old that can't be updated can't conceivably display it correctly. They might be able to display it as the individual characters, but they still won't know that's a date, or that they have to. As mipmap04 says, it's where Japanese dates were stored as a string or something, because goodness knows I've seen enough US dates stored as strings.

And inferring from the article that the tax authority is going to extend the old era, I assume that at the very least a good chunk of the government works on Japanese dates, so it's going to be important not to, say, print tax forms that have � in the date, etc.


UTC is good but not enough; it may still bite you in the behind.

What's the time difference between these 2 timestamps:

    2016-12-31 23:59:50 UTC    (unix time 1483232390)
    2017-01-01 00:00:10 UTC    (unix time 1483232410)
That's right: 21 seconds, due to the added leap second 23:59:60.

So then your next option is to use TAI (international atomic time). Of course for most applications, this extra/missing leap second doesn't matter.

And that's the crux of the issue. Given a level of abstraction, we're comfortable with a sufficient level of accuracy because it's the most convenient for 99% of the use cases. It takes a widely adopted tooling to bump the abstraction to a more accurate representation. In UNIX land, going from YYYYMMDDHHMMSS to a number of seconds has been a huge improvement. It's comfortable to use because all environments have the tooling to go back and forth from seconds to human-readable dates.

Try to use TAI and you start feeling a lot more lonely (ever tried to read logs timestamped in TAI? fun!) Most OS and server processes are used with the tradeoff that it's not a big deal if we have 2 events spaced a second apart and both timestamped the same (1483232399), since it's not that frequent.


I wrote a TAI parser library for Go (tai64/tai64n), and I agree that TAI timestamps are... terse..

Nice format though, other than readability. ;)


Wait: are you saying that Unix time does not take into account the leap second?!


Correct. POSIX time is defined as number of seconds per (non-leapsecond) day times number of complete day since the epoch, plus the number of seconds in the current day.

POSIX timestamps get weird around leap seconds. Time stamps get repeated, subtraction returns incorrect results, and so on.


If you use Java and the java.time API they added in the last release, you're covered for all of this.

https://docs.oracle.com/javase/8/docs/api/java/time/Instant....

In this segment, the Java Time-Scale is identical to UTC-SLS. This is identical to UTC on days that do not have a leap second. On days that do have a leap second, the leap second is spread equally over the last 1000 seconds of the day, maintaining the appearance of exactly 86400 seconds per day.

Java apps don't use UNIX time, they use something very similar called the Java timeline which is basically the same as UTC but leap seconds are smeared.

The java.time API is really incredibly thorough. It does of course have support for Japanese dates:

https://docs.oracle.com/javase/8/docs/api/java/time/chrono/J...

The type system and runtime checks also catch subtle errors like assuming "one day from now" and "in 24 hours from now" are the same thing.


IIRC google and the like solve this using a special time routine in their kernels that literally just spread the second out across the day. It's close enough.. and legal will still accept it for auditing requirements.


>"convert everything to internal UTC representation as quickly as possible, convert to local time as late as possible on the way out".

That's not a good approach to use for future events.


I should have qualified that with an exclusion for recurring and future events. Identifying present and past times, which is the majority case, is not that difficult. Future times is one of those cases where the availability heuristic fools you; you can readily think of cases where it is a concern, but it is the clear minority of things that have to deal with time.


> I don't want to say it's trivial, but it's not that hard once both you and your code base internalize "convert everything to internal UTC representation as quickly as possible, convert to local time as late as possible on the way out".

It's really not that easy. Recurrences and durations are the killers.

When you schedule that meeting for 4:00PM every Tuesday, what happens when daylight savings time kicks in?


> tax forms that have � in the date

Just make � the official symbol of the new era :)


I've just been on a 3 week trip to Japan and didn't see traditional Japanese dates used anywhere except on museum exhibits. Train tickets, bus tickets, hotel check-in / out dates, credit card receipts, tickets for various attractions etc. all displayed the date in ISO-8601 format.

It's interesting to ponder, but the traditional date format seems to have fallen out of use (probably with the advent of the computer era) and I genuinely don't think that this will be a problem.


Probably not with the tourist , though all my JR ticket I have are listed with traditional date though -- maybe they issued it with A.D because of you are tourist. Other tickets seems to be mixed though.

For example, of documents I have laying around my desk right now:

Alien card: A.D / Student card: A.D. / My number card (like US SSN): Traditional / Insurance card: Traditional / Water bill: Traditional / Electricity bill: Traditional (this one doesn't even tell you that it's traditional, it just say 30-07-xx) / Monthly health insurance bill: Traditional / Gas bill: A.D.

So it is pretty much in heavy use.


JR definitely produces different tickets depending on whether you used the machine in English or Japanese. (Or depending on what the station attendant thought would be most convenient for you; they can pick the output format and I've gotten both.)


Alien card? Do you mean the zairyu card?


If you are there to live rather than to tour you will find that the traditional date format is pervasive in daily life. Banking, legal documents, etc.


I lived in japan for a few months and all the dates for the immigration, housing, etc... in official papers had to be written in the traditional format.


You'll see more in banks and sometimes registering papers and I admit I hate it because I don't remember it as I use it maybe only once or twice a year and it provides no benefit to anyone.


At least train tickets show dates in Japanese era years.

Like this one for instance: https://blue-works.com/jprail/wp-content/uploads/2010/07/res...

The date at the bottom left is April 26th of the year Heisei 22 (so 2010)


At least it's clear it's not 2022 in 2010 but imagine if they were close... Now we're resetting it down to 1, perhaps no big confusion but still, a pointless system.


Is history pointless?


I was thinking this exactly. Not much of a problem for data, more of a problem for display of the data. A good stop-gap until they get enough information about the new era would be to just display the dates in UTC for a while or something.

I mean, unless they're storing the date/time in the database as a string, formatted for Japan's locale. Then they're screwed, kind of. I mean even then, it could be fixed with a stored procedure within an update statement.


As much as using UTC would be better, I suppose for many that will not be an option if they are accustomed to Japanese dates. I mean, I got flak in work because I was writing dates (as in, written on printed paper) in the ISO-8601 format and apparently the administration in France does not understand that.


I'm sure some unfortunate developer in Japan has made this mistake as I've seen datetimes stored as strings in America.

There's also probably logic in UIs somewhere that uses the string representation for something more critical than you'd expect.


There are all kinds of random places where this has potential to show up. For example, some backend process breaking (or worse, silently discarding data) because of validating dates in incoming data from another system as a string regex that expects the old era symbol.


Coming from a platform which stores time as local times and no time zone (also needing to handle SJIS text formatting on occasion) I wouldn't consider it a common problem, but the amount of code which doesn't handle dates that I with with is surprising high. I wouldn't be shocked if much of Japan's code has similar oddities (I suspect future dates will have a special comparison logic added for the overlap which results)


Even though it's only user facing you have to remember it's facing Japanese users. They are an extremely fussy demographic to deal with. I worked on enterprise billing systems in Japan before. I can imagine how not fun it is to be dealing with this issue right now.


I work on a large enterprise software product. We support Emperor dating (since the long gone legacy product from the late 1970s), and it is used, I just don't know how widely or for what reasons.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: