Module: ScoutAgent::CoreExtensions::Time

Defined in:
lib/scout_agent/core_extensions.rb

Overview

Extensions for the Time class.

Instance Method Summary collapse

Instance Method Details

#to_db_s(trim_seconds = false) ⇒ Object

Returns a String version of this Time in the format expected by SQLite. If trim_seconds is true, the sec() of this Time object will not be included in the String representation.



283
284
285
# File 'lib/scout_agent/core_extensions.rb', line 283

def to_db_s(trim_seconds = false)
  strftime("%Y-%m-%d %H:%M#{':%S' unless trim_seconds}")
end