class RDF::Literal::DateTime

Constants

ALTERNATIVE_FORMAT
DOT
EMPTY
TIMEZONE_FORMAT

Public Instance Methods

to_s() click to toggle source
# File lib/active_fedora.rb, line 24
def to_s
  @string ||= begin
    # Show nanoseconds but remove trailing zeros
    nano = @object.strftime('%N').sub(/0+\Z/, EMPTY)
    nano = DOT + nano if nano.present?
    @object.strftime(ALTERNATIVE_FORMAT) + nano + @object.strftime(TIMEZONE_FORMAT)
  end
end