Sha256: d5200a6fd0e3b3523c843041ee81fd84ce30ec74f453f90f76c9b9025b3e3152

Contents?: true

Size: 488 Bytes

Versions: 1

Compression:

Stored size: 488 Bytes

Contents

# Name::      Sysadmin::TimeExtension
# Author::    774 <http://id774.net>
# Created::   Sep 27, 2012
# Updated::   Sep 27, 2012
# Copyright:: 774 Copyright (c) 2012
# License::   Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.

require "time"

module Sysadmin
  module TimeExtension

    def Time.strict_parse(str)
      unix_epoch = Time.local(1970,1,1,0,0,0)
      time = Time.parse(str, nil) rescue nil
      time = nil if time == unix_epoch
      time
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sysadmin-0.1.2 lib/sysadmin/time_ext.rb