from: perldoc -f time

   time    Returns the number of non-leap seconds since whatever time the
           system considers to be the epoch, suitable for feeding to
           "gmtime" and "localtime". On most systems the epoch is 00:00:00
           UTC, January 1, 1970; a prominent exception being Mac OS Classic
           which uses 00:00:00, January 1, 1904 in the current local time
           zone for its epoch.


--Octavian

----- Original Message ----- From: "SurfShop" <contactat...@surfshopcart.com>
To: "Perl Beginners" <beginners@perl.org>
Sent: Monday, January 29, 2018 9:46 PM
Subject: What is time, anyway?


Basic time question here. Looking at sites such as http://perldoc.perl.org/functions/time.html, I'm not seeing what the time() function is based on. Does it return the time of the server, or UTC? Is it affected by any timezone setting on the server or in a script?

I tested it in a script and the result didn't change when I added a timezone, so it doesn't look like that affects it. I also ran that script on both my server, which is in the EST timezone, and on my laptop, which is in the MST timezone, and I got the same answer. I'm pretty sure that mean it's UTC, but I'd like some assurance.

The reason I'm asking is that I want to be certain that if I use time() in multiple scripts, they will all be based on the same 'source' so that any timestamp comparisons will be accurate. If there's a possibility that they won't be the same, then I'll need to convert them so that they will be the same.

Thanks,
Frank
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to