From: Matt Mongeau Date: 2013-03-07T05:07:12+09:00 Subject: Re: Compare Zulu time --047d7b60525e9b91db04d747228f Content-Type: text/plain; charset=ISO-8859-1 probably easier to do the opposite and convert the current time to Zulu time. expire_date = Date.parse("20130505172938Z") current_time = Time.now.utc then do something with them def days_away(from, to) ((to - from) / (60 * 60 * 24)).ceil end if days_away(current_time, expire_date) == 3 do_stuff end On Wed, Mar 6, 2013 at 2:56 PM, robert lengu wrote: > Hi > i need to compare zulu date and with current date > > example : > expire_date=20130505172938Z > > now i need compare that date with current time example > > current_time= Time.now.strftime( "%y%m%d%H%M%S" ) > > now if current_time is 3 days behind then expire_date then do something > ... .... > > but the problem is : > i cant convert zulu time into current time .. > > Any help will be really appreciate . > > -- > Posted via http://www.ruby-forum.com/. > > --047d7b60525e9b91db04d747228f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
probably easier to do the opposite and convert the current= time to Zulu time.

expire_date =3D Date.parse("20130505172938Z")
current_time =3D Time.now.utc

then do= something with them

def days_away(from, to)
=A0= ((to - from) / (60 * 60 * 24)).ceil
end
if days_away(current_time, expire_date) =3D=3D 3
=A0 do_stuff
end

=
On Wed, Mar 6, 2013 at 2:56 PM, robert lengu= <lists@ruby-forum.com> wrote:
Hi
i need to compare zulu date and with current date

example :
expire_date=3D20130505172938Z

now i need compare that date with current time example

current_time=3D Time.now.strftime( "%y%m%d%H%M%S" )

now if current_time is 3 days behind then expire_date =A0then do something<= br> ... ....

but the problem is :
i cant convert zulu time into current time ..

Any help will be really appreciate .

--
Posted via http://= www.ruby-forum.com/.


--047d7b60525e9b91db04d747228f--