Class: Time

Inherits:
Object show all
Defined in:
lib/rfm/utilities/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#to_fm_components(reset_time_if_before_today = false) ⇒ Object

Returns array of [date,time] in format suitable for FMP.


154
155
156
157
158
159
160
161
162
# File 'lib/rfm/utilities/core_ext.rb', line 154

def to_fm_components(reset_time_if_before_today=false)
	d = self.strftime('%m/%d/%Y')
	t = if (Date.parse(self.to_s) < Date.today) and reset_time_if_before_today==true
		"00:00:00"
	else
		self.strftime('%T')
	end
	[d,t]
end