Built-in date/time formatting function. HT: Rajgopal Vaithiyanathan