Allow customizable format

My modification sort of preserves the original behaviour, returning database friendly format in getValue(). You only have to cast the value to string:
print (string) $values['myDateField'];