def to_time(datetime, complete_date: :first, **opts)
			require 'time'
			return Time.now if datetime == :now
			begin
				fallback=Time.new(0) #supply the missing components
				return Time.parse(datetime,fallback)
			rescue ArgumentError
				year,month,day,time=split_date(datetime)
				case complete_date
				when :first
					month="01" if month == nil
					day="01" if day == nil
					time="00:00:00" if day == nil
				when :last
					month="12" if month == nil
					day=Months_end[month.to_i].to_s if day == nil
					time="23:59:59" if day == nil
				end
				return Time.parse("#{year}-#{month}-#{day}T#{time}",fallback)
			end
		end
def to_time(datetime, complete_date: :first, **opts)
			require 'time'
			return Time.now if datetime == :now
			begin
				fallback=Time.new(0) #supply the missing components
				return Time.parse(datetime,fallback)
			rescue ArgumentError
				year,month,day,time=split_date(datetime)
				case complete_date
				when :first
					month="01" if month == nil
					day="01" if day == nil
					time="00:00:00" if day == nil
				when :last
					month="12" if month == nil
					day=Months_end[month.to_i].to_s if day == nil
					time="23:59:59" if day == nil
				end
				return Time.parse("#{year}-#{month}-#{day}T#{time}",fallback)
			end
		end
Convert a Date/string into a Time