Re: Can you make a clock?
Reid Thompson <reid.thompson <at> ateb.com>
2009-10-01 00:27:55 GMT
Scott Andrechek wrote:
> I have tried all 3 tips and although i see how it would work maybe if i
> be more specific it'll help you help me : ) . I am making a program
> notify me how many days are left till an event happens (in the case of
> my program when a game comes out). This is what I use:
>
> puts 'Hey Scott : D'
> time=Time.new
> time_cod=Time.mktime(2009,11,13)
> time_operationflash=Time.mktime(2009,10,6)
> time_assassinscreed2=Time.mktime(2009,11,17)
> time_godofwar3=Time.mktime(2010,3)
> if (time_cod.to_i<0 or time_cod.to_i==0)
> puts 'It\'s already out!'
> else
> puts 'There are ' + (((((time_cod-time)/60)/60)/24).to_i).to_s + '
> days left until Call of Duty 4: Modern Warfare 2 is released'
> end
> if (time_operationflash.to_i<0 or time_operationflash.to_i==0)
> puts 'It\'s already out!'
> else
> puts 'There are ' +
> (((((time_operationflash-time)/60)/60)/24).to_i).to_s + ' days left
> until Operation Flashpoint: Dragon Rising is released'
> end
> if (time_assassinscreed2.to_i<0 or time_assassinscreed2==0)
> puts 'It\'s already out!'
> else
> puts 'There are ' +
> (((((time_assassinscreed2-time)/60)/60)/24).to_i).to_s + ' days left
(Continue reading)