module JamfRubyExtensions::Time::Utils

Public Instance Methods

j_msec() click to toggle source

@return [Integer] the milliseconds of the Time

   # File lib/jamf/ruby_extensions/time/utils.rb
50 def j_msec
51   strftime('%L').to_i
52 end
Also aliased as: jss_msec
jss_msec()
Alias for: j_msec
to_j_date() click to toggle source

@return [String] the Time formatted for a plain JSS XML date element

   # File lib/jamf/ruby_extensions/time/utils.rb
64 def to_j_date
65   strftime '%Y-%m-%d %H:%M:%S'
66 end
Also aliased as: to_jss_date
to_j_epoch() click to toggle source

@return [Integer] The Time as a unix epoch with milliseconds appended

   # File lib/jamf/ruby_extensions/time/utils.rb
56 def to_j_epoch
57   msec = strftime('%L').rjust(3, "0")
58   epoch = strftime('%s')
59   "#{epoch}#{msec}".to_i
60 end
Also aliased as: to_jss_epoch
to_j_utc() click to toggle source

@return [String] the Time formatted for a JSS UTC XML date element

   # File lib/jamf/ruby_extensions/time/utils.rb
70 def to_j_utc
71   strftime("%Y-%m-%dT%H:%M:%S.#{j_msec}%z")
72 end
Also aliased as: to_jss_utc
to_jss_date()
Alias for: to_j_date
to_jss_epoch()
Alias for: to_j_epoch
to_jss_utc()
Alias for: to_j_utc