in reply to Re: Internet Time
in thread Internet Time

No, you're wrong, it will still work. The trick is in

(time + 3600) % 86400

It doesn't matter what year it starts, as long as the number returned by this little piece of code, is the number of seconds since midnight from the BMT (Biel Mean Time), which is similar to GMT+1. The date is not important. Rememeber, the time function gives the number of seconds since midnight, different date for different systems, but still at GMT/UTC. Doing the % 86400 simply calculates the number of seconds since midnight, regardless of the date.

To answer your question, the system probably won't get a lot of appeal. I suggest you read the article on Swatch's website to get more info.

Funny enough, I returned from Switserland yesterday evening, and I was doing a lot of thinking on the Internet Time idea. It is good if you want to arrange meetings and stuff with people across different time zones, but it does not consider people travelling. Example, you get used to getting up at a specific time, now you travel to the other side of the world, where internet time is identical to your time, you'll permanently have jetlag!

Replies are listed 'Best First'.
Re: Re: Re: Internet Time
by theorbtwo (Prior) on Aug 11, 2002 at 21:16 UTC

    In purticular, since 86400 is the number of seconds in a day, this will work for any system where the epoch (that is, the time when time() returns 0) is at midnight GMT. As far as I know, all systems in existance fit that criterion. It wouldn't work for the Julian Date (where 0 is noon, IIRC), but I don't think there are any systems that use JD (MJD, the Modified Julian Date, does start at midnight, but I don't think there are any systems around that use MJD for time() either.).


    Confession: It does an Immortal Body good.

      I remember in DOS that the OS had no concept of what timezone it is running in, so it could not base the epoch in UTC (nee GMT). That might be true for older systems in general, and might be the case for embedded systems.

      It may work on every machine he tried it on, but he's still relying on emperical "happens to be implemented that way" functionality, not on specified, guaranteed functionality. IOW, it's "non-portable".

      There's nothing wrong with that; you just need to be aware of its limitations. E.g. re-qualify on any new platform.

        Shrug. The algo given relies on three things:

        1. The number given by time() increases by 1 every second of time that passes (IE is in seconds since some epoch.) (This is true for all OSes, and is part of the defintion of time() given in perlfunc.)
        2. The number given is invariant on the TZ the computer is in, assuming the computer is set up correctly. (This is true for all current ports that I am directly aware of, but not gaurnteed by perlfunc:time, nor perlport, as far as I can see. (I suspect it's even true for DOS, if you set $ENV{TZ} correctly, which I include under "assuming the computer is set up correctly", but I see no documentation of that in perldos.))
        3. The epoch refered to in point 1 is on midnight of some day. This isn't gaurneed by perlfunc:time, nor perlport, but I'm unaware of any platform where it isn't true, and it seems quite insane for it to be untrue.

        It should probably be noted that the only platforms I have programming experince on are DOS-based or Linux.


        Confession: It does an Immortal Body good.

Re: Re: Re: Internet Time
by John M. Dlugosz (Monsignor) on Aug 12, 2002 at 15:40 UTC
    You misunderstand my point.

    I agree that it works regardless of the base date.

    Rather, the documentation doesn't say "...UTC" for the Mac, implying that's it is based on the local time zone.

    I agree with you that it requires "the time function gives the number of seconds since midnight, different date for different systems, but still at GMT/UTC", but disagree that the specification of this function guarantees this.