I have a variable that has a UTC time tied with it, example:
offer_ends_at => Sun, 25 Nov 2012 07:59:59 UTC +00:00,
My goal is to create a new variable, and convert the Time to a seconds integer. I tried with some methods like
seconds = offer_ends_at.to_time.to_i
I end up getting a epoc time. I’m after an actual integer that contains the amount of seconds left until the date happens.
I you want ” an actual integer that contains the amount of seconds left until the date happens.”, then you can substract the timestamp you’re getting, to the current timestamp, ie :