proper sql date -> string conversion