It may seem that this would have been simpler and I could have covered more with the core *strftime* function. *strftime* respects the locale, though, so that would have failed on many systems.