Class: Time

Inherits:
Object show all
Extended by:
Icss::Meta::TimeSchema
Defined in:
lib/icss/type/simple_types.rb,
lib/icss/serialization/zaml.rb

Instance Method Summary collapse

Methods included from Icss::Meta::TimeSchema

fullname, receive

Methods included from Icss::Meta::PrimitiveSchema

#doc, #doc=, #to_schema

Instance Method Details

#to_zaml(z = ZAML.new) ⇒ Object



412
413
414
415
416
417
# File 'lib/icss/serialization/zaml.rb', line 412

def to_zaml(z=ZAML.new)
  # 2008-12-06 10:06:51.373758 -07:00
  ms = ("%0.6f" % (usec * 1e-6)).sub(/^\d+\./,'')
  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