Class: Fluent::Time

Inherits:
Time
  • Object
show all
Defined in:
lib/fluentd/plugin/out_syslog.rb,
lib/fluentd/plugin/out_syslog_buffered.rb

Instance Method Summary collapse

Instance Method Details

#timezone(timezone = 'UTC') ⇒ Object



93
94
95
96
97
98
99
100
# File 'lib/fluentd/plugin/out_syslog.rb', line 93

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