Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Swatch time

 [1/8] from: gchiu::compkarori::co::nz at: 6-Oct-2001 20:52


Has anyone written a function that converts local time to Swatch or Internet time? -- Graham Chiu

 [2/8] from: carl:cybercraft at: 7-Oct-2001 8:48


Can you define what Swatch time is? I've only heard they'd invented it. Is Internet time the same? If not, what is it? I think GMT when I think Internet time. And isn't it time Daylight Saving was banned? (Kicked in this morning here - grumble, grumble...) On 06-Oct-01, Graham Chiu wrote:
> Has anyone written a function that converts local time to > Swatch or Internet time?
-- Carl Read

 [3/8] from: gchiu:compkarori at: 7-Oct-2001 10:48


On Sun, 07 Oct 2001 08:48:33 +1200 Carl Read <[carl--cybercraft--co--nz]> wrote:
> Can you define what Swatch time is? I've only heard > they'd invented > it. Is Internet time the same? If not, what is it? I > think GMT > when I think Internet time.
See http://www.swatch.com I cobbled this together last night to-internettime: func [ time timezone /local gmttime hrs mins secs ] [ gmttime: time - timezone if gmttime < 0:00 [ gmttime: gmttime + 24:00 ] if gmttime > 24:00 [ gmttime: gmttime - 24:00 ] gmttime: parse to-string gmttime ":" hrs: to-integer first gmttime mins: to-integer second gmttime secs: pick gmttime 3 secs: either none? secs [ 0 ] [ to-integer secs ] gmttime: ( ( ( hrs * 3600 ) + ( mins * 60 ) + secs ) / 86.40 ) + 41 ; offset from GMT/UTC if gmttime > 1000 [ gmttime: gmttime - 1000 ] return ( to-integer ( gmttime * 100 ) ) / 100 ] internettime: does [ return to-internettime now/time now/zone ] Many of the brackets are redundant :)
> And isn't it time Daylight Saving was banned? (Kicked in > this morning > here - grumble, grumble...)
I think we should be permanently on Daylight saving - they should ban going back :) -- Graham Chiu

 [4/8] from: norsepower:uswest at: 6-Oct-2001 13:54


Yup. http://www.escribe.com/internet/rebol/m4983.html -Ryan

 [5/8] from: gchiu:compkarori at: 7-Oct-2001 13:04


On Sat, 06 Oct 2001 13:54:40 -0500 "<[norsepower--uswest--net]>" <[norsepower--uswest--net]> wrote:
> Yup. > > http://www.escribe.com/internet/rebol/m4983.html
Damm. Should have searched the archives :) Oh well, I needed to feed a time as a parameter to convert any time in any time zone .... My chat program now uses optionally internet time or local time :) -- Graham Chiu

 [6/8] from: joel:neely:fedex at: 6-Oct-2001 20:56


Hello, all Graham Chiu wrote:
> On Sat, 06 Oct 2001 13:54:40 -0500 > "<[norsepower--uswest--net]>" <[norsepower--uswest--net]> wrote: > > Yup. > > > > http://www.escribe.com/internet/rebol/m4983.html > > Damm. Should have searched the archives :) >
Except that the above version left out the modulus adjustment ... biel-mean-time-total-seconds: biel-mean-time-total-seconds + 86400 // 86400 ... to compensate for midnight rollover. Otherwise one gets results like this
>> internet-time
== 1035.9375 -jn- -- ; Joel Neely [joel--neely--fedex--com] 901-263-4460 38017/HKA/9677 REBOL [] foreach [order string] sort/skip reduce [ true "!" false head reverse "rekcah" none "REBOL " prin "Just " "another " ] 2 [prin string] print ""

 [7/8] from: gchiu:compkarori at: 7-Oct-2001 16:09


On Sat, 06 Oct 2001 20:56:50 -0500 Joel Neely <[joel--neely--fedex--com]> wrote:
> Except that the above version left out the modulus > adjustment ...
<<quoted lines omitted: 5>>
> >> internet-time > == 1035.9375
Well, at least my version checks for that :)
> -jn-
the most difficult part was finding out where Biel was <g> -- Graham Chiu

 [8/8] from: gchiu:compkarori at: 7-Oct-2001 16:24


On Sat, 06 Oct 2001 13:54:40 -0500 "<[norsepower--uswest--net]>" <[norsepower--uswest--net]> wrote:
> Yup. > > http://www.escribe.com/internet/rebol/m4983.html >
Hmm. Didn't know about /hour /minute as refinements of time! Pity you can't therefore do now/time/hour -- Graham Chiu

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted