solnic/virtus — pull request #128 by brutuscat (2012-11-13 10:13:46+00:00)
Title: Add Integer.to_datetime and Float.to_datetime coercion

This way integer unix-epoch timestamp and float unix-epoch timestamp with microseconds as fractional part can be coerced into a DateTime attribute.

```ruby
Virtus::Coercion::Fixnum.to_datetime(0)
=> Thu, 01 Jan 1970 00:00:00 +0000

date = Virtus::Coercion::Float.to_datetime(1000000000.999)
=> Sun, 09 Sep 2001 01:46:40 +0000
date.to_f
=> 1000000000.999
date.strftime("%3N") # milliseconds
=> "999"
```