daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 132 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env ruby
  2. require 'time'
  3.  
  4. MYSQL_FORMAT = '%Y-%m-%d %H:%M:%S'
  5.  
  6. $stdin.each do |line|
  7.   line.chop.gsub(%r['(\d+/\d+/\d{4} \d+:\d+:\d+ (?:AM|PM))']) do |matched|
  8.     Time.parse(matched).strftime(MYSQL_FORMAT)
  9.   end
  10. end
RAW Paste Data
Top