From: Dennis Oelkers Date: 2003-11-20T01:32:22+09:00 Subject: Re: Concerting a Date Object into a UNIX Timestamp In pan.2003.11.19.16.23.18.103013@sneakemail.com Simon Strandgaard wrote: > On Wed, 19 Nov 2003 17:15:08 +0100, Dennis Oelkers wrote: > > maybe a stupid question because I probably missed something reading the > > reference of "Programming Ruby", but how do I convert a Date Object into > > a UNIX Timestamp (seconds passed since the UNIX epoch)? > > irb(main):001:0> Time.now.to_i > => 1069258948 > irb(main):002:0> Ah, thank you very much for that helpful (and quick!) response, in fact I tried the to_i method, but on a Date object (doh!). irb(main):002:0> Date.new(2003, 11, 19).to_i NoMethodError: undefined method `to_i' for # from (irb):2 irb(main):003:0> Kind regards, Dennis Oelkers -- Dennis Oelkers | Webadministration | Zentraleinrichtung Rechenzentrum TU-Berlin | EN-Gebaeude, K042 | Telefon: 030-314-25029 Key Fingerprint: A6 7A B6 90 09 56 E8 32 02 40 6B 27 80 17 00 89 61 E7 CA 6F