Sha256: 42f76e215483a7f652f5c4f5e14bf6e10295edd478a90a007ca764c8275088c2

Contents?: true

Size: 578 Bytes

Versions: 18

Compression:

Stored size: 578 Bytes

Contents

#--
# Author::    Tyler Rick
# Copyright:: Copyright (c) 2007 QualitySmith, Inc.
# License::   Ruby License
# Submit to Facets?:: Yes.
#++

require 'date'
require 'rubygems'
require 'facets/core/date/to_time'

class Date
  def iso8601
    # Useful for SQL dates, among other things
    to_time().iso8601()[0..9]
  end
end

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test
class TheTest < Test::Unit::TestCase
  def test_iso8601
    assert_equal '2006-07-18', Date.civil(2006, 7, 18).iso8601()
  end
end
=end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
qualitysmith_extensions-0.0.13 lib/qualitysmith_extensions/date/iso8601.rb
quality_extensions-0.1.2 lib/quality_extensions/date/iso8601.rb
quality_extensions-0.1.1 lib/qualitysmith_extensions/date/iso8601.rb
quality_extensions-0.1.4 lib/quality_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.5 lib/qualitysmith_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.63 lib/qualitysmith_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.7 lib/qualitysmith_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.33 lib/qualitysmith_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.17 lib/qualitysmith_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.24 lib/qualitysmith_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.4 lib/qualitysmith_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.20 lib/qualitysmith_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.29 lib/qualitysmith_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.60 lib/qualitysmith_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.64 lib/qualitysmith_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.34 lib/qualitysmith_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.49 lib/qualitysmith_extensions/date/iso8601.rb
qualitysmith_extensions-0.0.6 lib/qualitysmith_extensions/date/iso8601.rb