From: Wesley J Landaker Date: 2003-12-04T13:26:05+09:00 Subject: Re: Swatch's internet time in Ruby [Code Inside] --Boundary-02=_Zdrz/5ksi//sHZa Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Description: signed data Content-Disposition: inline On Wednesday 03 December 2003 9:06 pm, Pablo Lorenzzoni wrote: > Hello ALL! > > Just wanted to share... maybe someone have a better way to do this: > > ---------- > class Time > > def bmt_hour > h =3D self.gmtime.hour + 1 > return 0 if h =3D=3D 24 > return h > end > > def beats > ((self.bmt_hour * 60 * 60) + (self.min * 60) + > self.sec) / 86.4 end > > protected :bmt_hour > end > ---------- > > require('beats.rb') and Time.now.beats returns the Internet Time in > beats Personally, I prefer my Internet Time in seconds: Time.now.utc =3D) =2D-=20 Wesley J. Landaker - wjl@icecavern.net OpenPGP FP: 4135 2A3B 4726 ACC5 9094 0097 F0A9 8A4C 4CD6 E3D2 --Boundary-02=_Zdrz/5ksi//sHZa Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQA/zrdZ8KmKTEzW49IRAqzBAJ0bG0loGSnxR2qUW3vAR/8K9vEGrACeIR2x TsvKh4Pv/Mwm3GIghNq5UQ8= =BZr/ -----END PGP SIGNATURE----- --Boundary-02=_Zdrz/5ksi//sHZa--