Fixed wrong date to string function