# Rails 2.1 - ActiveSupport::TimeWithZone - how to force a local time before saving?

**URL:** <https://www.ruby-forum.com/t/rails-2-1-activesupport-timewithzone-how-to-force-a-local-time-before-saving/144859>\
**Category:** Rails\
**Created:** [August 3, 2008, 12:08pm UTC](https://www.ruby-forum.com/t/rails-2-1-activesupport-timewithzone-how-to-force-a-local-time-before-saving/144859 "2008-08-03T12:08:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [August 3, 2008, 12:08pm UTC](https://www.ruby-forum.com/t/rails-2-1-activesupport-timewithzone-how-to-force-a-local-time-before-saving/144859/1 "2008-08-03T12:08:32Z")

</div>

I am currently saving record instances starting/ending dates without  
any time information, (date selection from a calendar\_date picker in  
my form)

def create  
@season\_schedule = SeasonSchedule.new(params[:season\_schedule])  
…

so I get it saved like in my DB (using config.time\_zone = “Paris”)

sd = ss1.starting\_at\_before\_type\_cast  
=\> “2008-10-31 23:00:00”

sd = ss1.starting\_at  
=\> Sat, 01 Nov 2008 00:00:00 CET +01:00

I would like to force the starting time to be 16:00:00;  
how should I proceed to get it right, and changing only the time,  
should be in local time… something like :  
@season\_schedule.starting\_at.set\_local\_time(“16:00:00”)

thanks for your enlightments…

erwin
