Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'time'
- MYSQL_FORMAT = '%Y-%m-%d %H:%M:%S'
- $stdin.each do |line|
- line.chop.gsub(%r['(\d+/\d+/\d{4} \d+:\d+:\d+ (?:AM|PM))']) do |matched|
- Time.parse(matched).strftime(MYSQL_FORMAT)
- end
- end
Add Comment
Please, Sign In to add comment