# Server time

**URL:** <https://www.ruby-forum.com/t/server-time/94585>\
**Category:** Rails\
**Created:** [May 8, 2006, 3:29am UTC](https://www.ruby-forum.com/t/server-time/94585 "2006-05-08T03:29:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mohammad](https://www.ruby-forum.com/u/mohammad)\
**Post date:** [May 8, 2006, 3:29am UTC](https://www.ruby-forum.com/t/server-time/94585/1 "2006-05-08T03:29:39Z")

</div>

Hello I just set up my db to save Time(now)(IN SQL not ruby’s Time.now)  
But, this is local user time correct? If not or even so I would also  
like to be able to call servers Time.now in my app so how can I do this?

Thanks in advance,  
noobie Mohammad

---

<div class="post-metadata">

**Author:** ![mohammad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mohammad](https://www.ruby-forum.com/u/mohammad)\
**Post date:** [May 8, 2006, 6:56pm UTC](https://www.ruby-forum.com/t/server-time/94585/2 "2006-05-08T18:56:26Z")

</div>

Mohammad wrote:

> Hello I just set up my db to save Time(now)(IN SQL not ruby’s Time.now)  
> But, this is local user time correct? If not or even so I would also  
> like to be able to call servers Time.now in my app so how can I do this?
> 
> Thanks in advance,  
> noobie Mohammad

Time.now is local user time correct?

---

<div class="post-metadata">

**Author:** ![mohammad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mohammad](https://www.ruby-forum.com/u/mohammad)\
**Post date:** [May 8, 2006, 7:02pm UTC](https://www.ruby-forum.com/t/server-time/94585/3 "2006-05-08T19:02:32Z")

</div>

Mohammad wrote:

> Hello I just set up my db to save Time(now)(IN SQL not ruby’s Time.now)  
> But, this is local user time correct? If not or even so I would also  
> like to be able to call servers Time.now in my app so how can I do this?
> 
> Thanks in advance,  
> noobie Mohammad

MySQL has no idea what local user time even means. If you setup a time  
default in the DB it will always be Server time. And Time.now is also  
always server time.

You cant really get the local user time in ruby code without some  
special handling and collecting of the users timezone.
