It appears that the roundtrip of a DateTime object to yaml and
back via YAML.dump and YAML.load results in a Time object, instead
of a DateTime object:
>> dt = DateTime.now
>> temp = YAML.dump(dt)
>> restored = YAML.load(temp)
>> restored.class
=> Time
Is there any more elegant way to deal with this other than
hard-coding a conversion back to DateTime:
>> temp = YAML.dump(dt)
>> restored = YAML.load(temp).to_datetime
>> restored.class
=> DateTime
?
Thanks!
-glenn
--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---