# TzTime doesn't get saved in ActiveRecord?

**URL:** <https://www.ruby-forum.com/t/tztime-doesnt-get-saved-in-activerecord/105720>\
**Category:** Rails\
**Created:** [June 1, 2007, 7:26pm UTC](https://www.ruby-forum.com/t/tztime-doesnt-get-saved-in-activerecord/105720 "2007-06-01T19:26:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reynard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/6bbea6/32.png) [@Reynard](https://www.ruby-forum.com/u/Reynard)\
**Post date:** [June 1, 2007, 7:26pm UTC](https://www.ruby-forum.com/t/tztime-doesnt-get-saved-in-activerecord/105720/1 "2007-06-01T19:26:44Z")

</div>

after reading Rick’s blog about tztime plugin:  
[http://activereload.net/2007/4/13/dealing-with-timezones](http://activereload.net/2007/4/13/dealing-with-timezones)  
It seems that you should be able to set TzTime object to a datetime  
field, which will automatically converts it to UTC before saving,  
right?  
However it doesn’t seem to work for me. setting TzTime to a datetime  
field doesn’t even save it to the database.

@something.posted\_at = TzTime.parse(‘2006-1-1 9pm’)  
@something.save  
@something.reload  
@something.posted\_at # =\> nil

the actual value of posted\_at in database is 0000-00-00 00:00:00  
(mysql default value for nil datetime)

Also, tz\_time\_attributes throws exception that acts\_like? is not  
defined.

BTW, I’m using rails 1.2.3. Does this feature need rails edge?

Regards,

- reynard
