Class | Sequel::SQLTime |
In: |
lib/sequel/sql.rb
|
Parent: | ::Time |
Time subclass that gets literalized with only the time value, so it operates like a standard SQL time type.
Create a new SQLTime instance given an hour, minute, second, and usec.
# File lib/sequel/sql.rb, line 36 36: def create(hour, minute, second, usec = 0) 37: t = date 38: meth = Sequel.application_timezone == :utc ? :utc : :local 39: public_send(meth, t.year, t.month, t.day, hour, minute, second, usec) 40: end
Return a string in HH:MM:SS format representing the time.
# File lib/sequel/sql.rb, line 49 49: def to_s(*args) 50: if args.empty? 51: strftime('%H:%M:%S') 52: else 53: # Superclass may have defined a method that takes a format string, 54: # and we shouldn't override in that case. 55: super 56: end 57: end