in reply to time() off

The perl time function returns epoch time, which is likely to be (except on strange sysmtems) "the number of non-leap seconds since 00:00:00 UTC, January 1, 1970" That means it's in "GMT" (or UTC) time. If you want the local time, you want to feed the value of time to the (conveniently named) function localtime. If you want that pretty string like "Thu Sep 9 09:31:13 2004" then call localtime in scalar context. If you have more specific formatting needs, I would use POSIX::strftime().

--
edan

Replies are listed 'Best First'.
Re^2: time() off
by ketema (Scribe) on Sep 09, 2004 at 13:49 UTC
    ok, understood, about time(), but localtime is still off, its not 1:48 in florida right now its 9:48
    my localtime() returns Thu Sep 9 13:48:38 2004, and that's wrong. what will fix that?
      ok, so maybe I'm just not getting it...Does localtime simply return time in a nice format?, and not the actual "Local Time" of your system? if so I get it, I think thats dumb, but I get it...If localtime is actually supposed to return the "Local time" of my stytem then its off. Please clarify.

        Have you bothered to read localtime? I think it explains what it does in quite a bit of detail. What don't you understand?

        localtime returns the "Local Time" of your system, in two different ways, depending on how you ask it. But either way, it is the local time. If localtime's idea of the local time is not what your watch reads, then check either a) your watch, or b) your system clock.

        --
        edan