Re: [Rails] Date formats

2011-10-27 Thread Tom Allison
Thank you very much. I had a feeling it was a postgres thing and not a rails thing. I'm impressed at what rails/ruby can do about timezone just the same. Personally, I find working with date/time to be the most problematic data type *ever*! On Wed, Oct 26, 2011 at 4:16 AM, Simon Riggs wrote: >

Re: [Rails] Date formats

2011-10-26 Thread Simon Riggs
On Tue, Oct 25, 2011 at 5:52 PM, Tom Allison wrote: > Just realized I have a nice problem. > > using Postgresql... > > When I save something via Rails to the table it's saved with a GMT > offset (so 12:00 becomes 16:00) > But the database is configured to save everything as GMT. > > Which means --

Re: [Rails] Date formats

2011-10-25 Thread Scott Ribe
On Oct 25, 2011, at 11:50 AM, Tom Allison wrote: > timestamp with time zone Which means that it is offset by postgres to/from the time zone of the client making the query, your rails app in this case. Timestamp without time zone makes no adjustments, just storing/retrieving it as supplied. --

Re: [Rails] Date formats

2011-10-25 Thread Tom Allison
OK, so the default time saved is UTF-8. Which means that storing it a what appears to be now+4 hours is correct. I think my question falls into a postgresql question. When I query these fields it appears as the time (16:00 instead of 12:00) is identified as "timestamp with time zone" -- unexpected.

Re: [Rails] Date formats

2011-10-25 Thread Philip Hallstrom
> Just realized I have a nice problem. > > using Postgresql... > > When I save something via Rails to the table it's saved with a GMT > offset (so 12:00 becomes 16:00) > But the database is configured to save everything as GMT. > > Which means -- when I query it via SQL it's coming back as now +

[Rails] Date formats

2011-10-25 Thread Tom Allison
Just realized I have a nice problem. using Postgresql... When I save something via Rails to the table it's saved with a GMT offset (so 12:00 becomes 16:00) But the database is configured to save everything as GMT. Which means -- when I query it via SQL it's coming back as now + 4 hours instead o