Take the 2008 Git User's Survey and help out! [ hide ]

public
Fork of Caged/gitnub
Description: A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.
Homepage: http://alternateidea.com
Clone URL: git://github.com/benstiglitz/gitnub.git
Search Repo:
commit  b4da17cd0588d92d01e3c04f377f23a17aecd288
tree    3a159339cc8039fbe4b21a8f894029f168011be1
parent  fc4de4ef7a337d4b391fad6ff33d357cf2bad074
gitnub / lib / time_extensions.rb
100644 14 lines (14 sloc) 0.445 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Time
  def to_system_time(style = :full)
    formatter = OSX::NSDateFormatter.alloc.init
    case style
      when :full
        formatter.dateStyle = OSX::NSDateFormatterMediumStyle
        formatter.timeStyle = OSX::NSDateFormatterShortStyle
      when :time
        formatter.dateStyle = OSX::NSDateFormatterNoStyle
        formatter.timeStyle = OSX::NSDateFormatterShortStyle
    end
    formatter.stringFromDate(self.to_ns)
  end
end