Hi,

I'm using sequel to connect to a postgres DB. I have a table that have 
column definition type Time, so only hours::minute:second values and no 
date (e.g. 2012-03-05). When I ran a query to retrieve the the values in 
that table
and print the value, sequel for some reasons append the date to it, but if 
i query the database directly it doesn't. 
for example with sequel when I do 
**please ignore typos :)
...
t = Work.select.all
t.each do |row|
 puts row[:start_time]
end
...

It prints everytime current date + the time in the DB. I just want time! 
so if today is the 11 of jan the printed results would be
'2014-01-11 09:30:00'

I just want '09:30:00'  so to check the type of the data I retrieve I did 
this

...
t = Work.select.all
t.each do |row|
 puts row[:start_time].class 
end

It prints Sequel::SQLTime ! which is correct. If I read the documentation 
here 
: https://github.com/jeremyevans/sequel/blob/master/doc/object_model.rdoc 
it says
*"Sequel::SQLTime is a Time subclass. However, it is treated specially by 
Sequel in that only the time component is literalized, not the date part. 
This type is used to represent SQL time types, which do not contain date 
information."*

But unfortunately I doesn't give just hours it does give the date part! Is 
there a good way to overwrite the method in the Class Work < Sequel::Model ?

Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to