Module: Airbrake::TimeTruncate Private

Defined in:
lib/airbrake-ruby/time_truncate.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

TimeTruncate contains methods for truncating time.

Since:

  • v3.2.0

Class Method Summary collapse

Class Method Details

.utc_truncate_minutes(time) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Truncate time to floor minute and turn it into an RFC3339 timestamp.

Parameters:

  • time (Time, Integer, Float)

Returns:

  • (String)

Since:

  • v3.2.0



11
12
13
14
15
# File 'lib/airbrake-ruby/time_truncate.rb', line 11

def self.utc_truncate_minutes(time)
  tm = Time.at(time).getutc

  Time.utc(tm.year, tm.month, tm.day, tm.hour, tm.min).to_datetime.rfc3339
end