def to_ruby(value)
t = case value
when Integer
Time.at(value).utc
when String
DateTime.strptime(value, DATETIME_FORMAT)
else
fail ArgumentError, "Invalid value type for DateType property: #{value.inspect}"
end
DateTime.civil(t.year, t.month, t.day, t.hour, t.min, t.sec)
end