lib/external/audio_harvester.rb
# calculate the audio recording start date and time

calculate the audio recording start date and time
calculate the audio recording start date and time
def recording_start_datetime(full_path, utc_offset)
      if File.exists? full_path
        modified_time = File.mtime full_path
        file_name = File.basename full_path
        datetime_from_file = modified_time
        file_name.scan(/.*_(\d{4})(\d{2})(\d{2})_(\d{2})(\d{2})(\d{2})\..+/) do |year, month, day, hour, min ,sec|
          datetime_from_file = DateTime.new(year.to_i, month.to_i, day.to_i, hour.to_i, min.to_i, sec.to_i, utc_offset)
        end
        datetime_from_file
      else
        nil
      end
    end
def recording_start_datetime ( full_path , utc_offset ) if File . exists? full_path modified_time = File . mtime full_path file_name = File . basename full_path datetime_from_file = modified_time file_name . scan ( / .*_( \d {4})( \d {2})( \d {2})_( \d {2})( \d {2})( \d {2}) \. .+ / ) do | year , month , day , hour , min , sec | datetime_from_file = DateTime . new ( year . to_i , month . to_i , day . to_i , hour . to_i , min . to_i , sec . to_i , utc_offset ) end datetime_from_file else nil end end
calculate the audio recording start date and time
calculate the audio recording start date and time
#access_time = File.atime full_path
 #change_time = File.ctime full_path
 # _yyyyMMdd_HHmmss.

full_path
utc_offset