Sha256: 6641e81fc9e9e2be3a623ca74ccc161d40b29ed792955cc905aa5f2be6b406b5

Contents?: true

Size: 266 Bytes

Versions: 25

Compression:

Stored size: 266 Bytes

Contents

# frozen_string_literal: true

require 'date'

DateTime.class_eval do
  # @return [DateTime]
  def in_utc
    utc? ? self : in_time_zone('UTC').to_datetime
  end
end

Time.class_eval do
  # @return [Time]
  def in_utc
    utc? ? self : in_time_zone('UTC')
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
ruby-rails-extensions-2.1.2 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.2.pre.pre.pre.1 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.1 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.14 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.13 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.12 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.11 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.10 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.9 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.8 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.7 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.6 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.5 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.4 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.3 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.2 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.1.0.pre.rc.1 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.0.1 lib/ruby-rails-extensions/extensions/in_utc.rb
ruby-rails-extensions-2.0.1.pre.rc.1 lib/ruby-rails-extensions/extensions/in_utc.rb