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
balinterdi-activewarehouse-etl-0.9.2 lib/etl/transform/string_to_datetime_transform.rb
activewarehouse-etl-0.9.1 lib/etl/transform/string_to_datetime_transform.rb