Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8330359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:05:59+00:00 2026-06-09T02:05:59+00:00

Here is a query result from Postgres: $ psql … -c ‘select the_date from

  • 0

Here is a query result from Postgres:

$ psql ... -c 'select the_date from foo where foo_id in (998,999)'
     the_date      
------------------------
 2012-03-07 09:34:47.98
 2012-03-16 11:31:25.336

the_date is “timestamp without time zone”.

Here is a Ruby program:

#!/usr/bin/env ruby

require 'sequel'

@DB = Sequel.connect({...})
query = "select the_date from foo where foo_id in (998,999)"
@DB[query].each do |row|
  warn row
end

and some output:

{:the_date=>2012-03-07 09:34:47 -0600}
{:the_date=>2012-03-16 11:31:25 -0500}

Where does the -0500 and -0600 come from? That is the “Olson timezone” of the server and the client machines (US/Central), but why does Ruby add it and psql does not?

I’ve been reading the docs, and I’m thoroughly confused.

The server is Postgres 9.0.4, the client is psql 9.1.4, sequel is 3.33.0.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:06:00+00:00Added an answer on June 9, 2026 at 2:06 am

    The column is of type ‘timestamp without timezone’. Thus when Postgres displays a value in this column it just displays the timestamp with no timezone. However, Sequel wants to convert a Postgres timestamp to an instance of the Ruby Time class, and an instance of the Time class must have a timezone specified – either it’s a time in the local timezone or it’s a time in UTC. Thus Sequel must choose one. By default, it’s choosing your local timezone.

    You may configure the database and application timezone in Sequel. See https://www.rubydoc.info/gems/sequel/4.36.0/Sequel/Timezones

    For example, here’s the default Sequel behavior with a database I had handy:

    >   c['select * from actors'].each do |row|; puts row[:created_at]; end
    Thu Jul 12 20:33:17 -0400 2012
    

    Here the timestamp is assumed to be in my local timezone (EDT).

    However, if I do this:

    > Sequel.database_timezone = :utc
     => :utc 
    > c['select * from actors'].each do |row|; puts row[:created_at]; end
    Thu Jul 12 20:33:17 UTC 2012
    

    Then the timestamp is assumed to be in UTC.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my query Select Gender from Table The result pane shows 1 1
SQL server 2008 Hello here is my query which returns the result SELECT *
Here's my query SELECT * FROM wp_postmeta WHERE meta_value LIKE '.$_POST['username'].' AND meta_value LIKE
I have created this query to fetch some result from database. Here is my
I've simple Linq2Sql query: var result = from t in MyContext.MyItems select new MyViewModelClass()
I'm trying to query a single result from two tables in my database. Here
Here's the query: select ( SELECT COUNT(*) FROM Sending s WHERE (ConfID = 1)
Here's my query, it is fairly straightforward: SELECT INVOICE_ITEMS.II_IVNUM, INVOICE_ITEMS.IIQSHP FROM INVOICE_ITEMS LEFT JOIN
I am having trouble getting well formatted results from my mysql query. Here is
I can't figure out what I am doing wrong with my query here. SELECT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.