Common date conversions in the RPG language (This code is in the RPG language, however a Ruby extension was used to add syntax highlighting)