def locale_time(*args)
      options = args.extract_options!
      locale_dating_naming_checks(args, options)

      # Loop through all the given attributes that should be wrapped using the same settings.
      args.each do |attrib|
        getter_name, setter_name = locale_dating_wrapper_method_names(attrib, options)
        # Define the code to execute when the method is called
        # Create new methods for get and set calls with blocks for implementation.
        class_eval do
          # == Create the GET methods
          # EX: def start_time_as_text()
          define_method getter_name do
            value = self.send(attrib)
            I18n.l(value.in_time_zone, :format => options[:format]) if value
          end
          # == Create the SET methods
          # EX: def start_time_as_text=()
          define_method setter_name do |value|
            if !value.blank?
              time_value = DateTime.strptime(value.to_s, I18n.t("time.formats.#{options[:format]}"))
              time_value = Time.zone.local(time_value.year, time_value.month, time_value.day,
                                           time_value.hour, time_value.min, time_value.sec)
            end
            # Keep the date from the given value and preserve the original time part
            self.send("#{attrib}=", time_value)
          end
        end
      end
    end
def locale_time(*args)
      options = args.extract_options!
      locale_dating_naming_checks(args, options)

      # Loop through all the given attributes that should be wrapped using the same settings.
      args.each do |attrib|
        getter_name, setter_name = locale_dating_wrapper_method_names(attrib, options)
        # Define the code to execute when the method is called
        # Create new methods for get and set calls with blocks for implementation.
        class_eval do
          # == Create the GET methods
          # EX: def start_time_as_text()
          define_method getter_name do
            value = self.send(attrib)
            I18n.l(value.in_time_zone, :format => options[:format]) if value
          end
          # == Create the SET methods
          # EX: def start_time_as_text=()
          define_method setter_name do |value|
            if !value.blank?
              time_value = DateTime.strptime(value.to_s, I18n.t("time.formats.#{options[:format]}"))
              time_value = Time.zone.local(time_value.year, time_value.month, time_value.day,
                                           time_value.hour, time_value.min, time_value.sec)
            end
            # Keep the date from the given value and preserve the original time part
            self.send("#{attrib}=", time_value)
          end
        end
      end
    end
Define how to split out a single date_time column/attribute into two attributes that can set the date and
 time portions independently. Can be called multiple times per

 ==== Arguments
 Accepts a list of attribute names that access date related model data.
 * <tt>options</tt> - Options for overriding configuration.

 ==== Options
 * <tt>:format</tt> - The desired time format name from the locale file to use for displaying and parsing
                      the value as text.
 * <tt>:ending</tt> - The suffix used on the wrapping methods for accessing and assigning the value.
 * <tt>:name</tt> - The explicit wrapper method name to use for reading and writing the value as text.
                    Overrides and :ending option.

 ==== Example
 Standard usage accepting defaults.
     date_time_split :starts_at
     # creates methods "starts_at_date" and "starts_at_time" that both write to the "starts_at" column.

 Override default method maps to custom ones.
     date_time_split :starts_at, :date => :date_starts_at, :time_starts_at
     # creates methods "date_starts_at" and "time_starts_at" that both write to the "starts_at" column.