# DateTime problem in AWS

**URL:** <https://www.ruby-forum.com/t/datetime-problem-in-aws/58785>\
**Category:** Rails\
**Created:** [April 25, 2006, 10:35pm UTC](https://www.ruby-forum.com/t/datetime-problem-in-aws/58785 "2006-04-25T22:35:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [April 25, 2006, 10:35pm UTC](https://www.ruby-forum.com/t/datetime-problem-in-aws/58785/1 "2006-04-25T22:35:31Z")

</div>

I am trying to implement a web service that returns a datetime stamp as  
part of the structured object returned in the response. As noted in  
another post ([ActionWebService date casting error - Rails - Ruby-Forum](http://www.ruby-forum.com/topic/59762)), there seems to be  
a problem with the DateTime.parse method in that it does not match the  
year. Is anyone aware of workaround for this issue?

My current idea (a hack, but it seems to work) is to modify the  
AWS/casting.rb module so that casting of datetime stamp is done by the  
Time class instead of DateTime. Essentially, I have changed line 106 to  
read “Time.parse(value.to\_s).” This is not a best practice for sure, so  
I am eagerly in search of another solution.

Thanks.

Josh

---

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [April 26, 2006, 7:43pm UTC](https://www.ruby-forum.com/t/datetime-problem-in-aws/58785/2 "2006-04-26T19:43:17Z")

</div>

You can use :time data type for your timestamps instead of modifying  
casting.rb.
