method
visit_DateTime
v2_6_3 -
Show latest stable
- Class:
Psych::Visitors::YAMLTree
visit_DateTime(o)public
No documentation available.
# File ext/psych/lib/psych/visitors/yaml_tree.rb, line 225
def visit_DateTime o
formatted = if o.offset.zero?
o.strftime("%Y-%m-%d %H:%M:%S.%9N Z".freeze)
else
o.strftime("%Y-%m-%d %H:%M:%S.%9N %:z".freeze)
end
tag = '!ruby/object:DateTime'
register o, @emitter.scalar(formatted, nil, tag, false, false, Nodes::Scalar::ANY)
end