Class: Time

Inherits:
Object show all
Defined in:
lib/vendor/puppet/util/zaml.rb

Instance Method Summary collapse

Instance Method Details

#to_zaml(z) ⇒ Object



376
377
378
379
380
381
# File 'lib/vendor/puppet/util/zaml.rb', line 376

def to_zaml(z)
  # 2008-12-06 10:06:51.373758 -07:00
  ms = ("%0.6f" % (usec * 1e-6))[2..-1]
  offset = "%+0.2i:%0.2i" % [utc_offset / 3600, (utc_offset / 60) % 60]
  z.emit(self.strftime("%Y-%m-%d %H:%M:%S.#{ms} #{offset}"))
end