Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/out_mail.rb

Instance Method Summary collapse

Instance Method Details

#timezone(timezone = 'UTC') ⇒ Object



212
213
214
215
216
217
218
219
# File 'lib/fluent/plugin/out_mail.rb', line 212

def timezone(timezone = 'UTC')
  old = ENV['TZ']
  utc = self.dup.utc
  ENV['TZ'] = timezone
  output = utc.localtime
  ENV['TZ'] = old
  output
end