class Date
A date type converter.
Definitions
def name
Get the SQL type name for date.
Signature
-
returns
String The type name.
Implementation
def name
"DATE"
end
def parse(string)
Parse a date value from the database.
Signature
-
parameter
stringString | Nil The raw string value.
-
returns
Time | Nil The parsed date as a UTC Time object.
Implementation
def parse(string)
if string
parts = string.split(/[\-\s:]/)
return Time.utc(*parts)
end
end