Sha256: 7b26420de5d681a153942512bff38fb8b79be7b401b8ebc1d118f6022efe96d3

Contents?: true

Size: 531 Bytes

Versions: 22

Compression:

Stored size: 531 Bytes

Contents

module ETL #:nodoc:
  module Transform #:nodoc:
    # Transform a String representation of a date to a DateTime instance
    class StringToDateTimeTransform < ETL::Transform::Transform
      # Transform the value using DateTime.parse.
      #
      # WARNING: This transform is slow (due to the Ruby implementation), but if you need to 
      # parse timestamps before or after the values supported by the Time.parse.
      def transform(name, value, row)
        DateTime.parse(value) unless value.nil?
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 9 rubygems

Version Path
aeden-activewarehouse-etl-0.9.1 etl/lib/etl/transform/string_to_datetime_transform.rb
colincasey-activewarehouse-etl-0.9.4 lib/etl/transform/string_to_datetime_transform.rb
colincasey-activewarehouse-etl-0.9.5 lib/etl/transform/string_to_datetime_transform.rb
factorylabs-activewarehouse-etl-0.9.1.2 lib/etl/transform/string_to_datetime_transform.rb
factorylabs-activewarehouse-etl-0.9.1.3 lib/etl/transform/string_to_datetime_transform.rb
factorylabs-activewarehouse-etl-0.9.1.4 lib/etl/transform/string_to_datetime_transform.rb
factorylabs-activewarehouse-etl-0.9.1.5 lib/etl/transform/string_to_datetime_transform.rb
factorylabs-activewarehouse-etl-0.9.1.6 lib/etl/transform/string_to_datetime_transform.rb
factorylabs-activewarehouse-etl-0.9.1.7 lib/etl/transform/string_to_datetime_transform.rb
jayzes-activewarehouse-etl-0.9.1.1 lib/etl/transform/string_to_datetime_transform.rb
jayzes-activewarehouse-etl-0.9.1.2 lib/etl/transform/string_to_datetime_transform.rb
jayzes-activewarehouse-etl-0.9.1 lib/etl/transform/string_to_datetime_transform.rb
activewarehouse-etl-1.0.0 lib/etl/transform/string_to_date_time_transform.rb
activewarehouse-etl-1.0.0.rc1 lib/etl/transform/string_to_date_time_transform.rb
etl-0.9.5.rc1 lib/etl/transform/string_to_date_time_transform.rb
activewarehouse-etl-sgonyea-0.9.6 lib/etl/transform/string_to_date_time_transform.rb
activewarehouse-etl-0.9.5.rc1 lib/etl/transform/string_to_datetime_transform.rb
darrell-activewarehouse-etl-0.9.1.6 lib/etl/transform/string_to_datetime_transform.rb
darrell-activewarehouse-etl-0.9.1.4 lib/etl/transform/string_to_datetime_transform.rb
factorylabs-activewarehouse-etl-0.9.1.8 lib/etl/transform/string_to_datetime_transform.rb