php class helper for formatting datetime