Method: HexaPDF::Serializer#serialize_time
- Defined in:
- lib/hexapdf/serializer.rb
#serialize_time(obj) ⇒ Object
The ISO PDF specification differs in respect to the supported date format. When converting to a date string, a format suitable for both is output.
See: PDF2.0 s7.9.4, ADB1.7 3.8.3
298 299 300 301 302 303 304 305 306 |
# File 'lib/hexapdf/serializer.rb', line 298 def serialize_time(obj) zone = obj.strftime("%z'") if zone == "+0000'" zone = '' else zone[3, 0] = "'" end serialize_string(obj.strftime("D:%Y%m%d%H%M%S#{zone}")) end |