# File lib/active_ldap/schema/syntaxes.rb, line 179 def type_cast(value) return value if value.nil? or value.is_a?(Time) match_data = FORMAT.match(value) if match_data required_components = match_data.to_a[1, 6] return value if required_components.any?(&:nil?) year, month, day, hour, minute, second = required_components.collect(&:to_i) fraction = match_data[-2] fraction = fraction.to_f if fraction time_zone = match_data[-1] Time.send(:make_time, year, month, day, hour, minute, second, fraction, time_zone, Time.now) else value end end