Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to define a custom locale with my own calendar settings. In this locale, we set a specified year as the first year. For example, if I define a en_UNIX.UTF-8, I'd like to set AD 1970 as year 1, and AD 1970 as year 2.

Is there any way to do this in Linux/BSD? I looked into system's locale files and found they only defined the first day of week, currency and so on except the first year of calendar...

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Use of the gregorian calendar is hard-coded in glibc:

So anything that uses the C library ("system") routines - gmtime_r, localtime_r and so on - to convert between seconds-since-the-epoch and broken-down-date format, will stick to the "standard" calendar (365 days in a year, Gregorian leap-year formula, 7 days per week...).

For code you write yourself, you could use the ICU Project's libraries and provide your own non-Gergorian calendar specification in the Unicode Common Locale Data Repository XML format.

I'm pretty sure you don't want to do that.

share|improve this answer
I found many GNOME applications are depends on libicu, is there anyway to set non-Gergorian calender for these applications? –  Lingfeng Xiong Apr 25 '13 at 12:29
@LingfengXiong Not usefully, because libicu is probably mostly used to deal with unicode character set and font handling for internationalisation, not for date handling. It may be used for that, but there's not much of a way to find out: you'd need to find/create a suitable calendar definition, make sure it's installed/available, set your timezone to that one, and see if it makes a difference. And even if it does, it might not in all places in the code, and if it doesn't, perhaps that build simply can't or won't load it without a recompile, but would. –  Gabe Apr 25 '13 at 16:27
thanks for your kindly help :-) Does Mac OS X (GUI applications) and FreeBSD handle this kind of things in the same way? –  Lingfeng Xiong Apr 26 '13 at 9:43
The situation on FreeBSD is essentially identical to Linux; I have absolutely no idea what support MacOS provides for time/date handling beyond basic Unix routines, and to what extent you can expect it to be used. –  Gabe Apr 26 '13 at 12:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.