Skip to content

Instantly share code, notes, and snippets.

@juno
Created January 7, 2011 06:52
Show Gist options
  • Select an option

  • Save juno/769207 to your computer and use it in GitHub Desktop.

Select an option

Save juno/769207 to your computer and use it in GitHub Desktop.
convert heroku logs to localtime
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'time'
pattern = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}-\d{2}:\d{2}) (.+)$/
ARGF.each { |line| puts "#{Time.parse($1)} #{$2}" if line =~ pattern }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment