Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Obtaining The Exact Time

by Russ (Deacon)
on Oct 08, 2002 at 00:08 UTC ( [id://203534]=note: print w/replies, xml ) Need Help??


in reply to Obtaining The Exact Time

If you want a unique filename, combine the timestamp with the process ID of the fork handling the connection...

Your question asks how to get the exact time, but I would be more worried about a guaranteed unique value.

Russ
Brainbench 'Most Valuable Professional' for Perl

P.S. Look at POSIX::strftime. I think

my $Now = strftime('%Y%m%d', localtime)
is much prettier to use than
($sec, $min, ...) = (localtime())[0..5]; $Now = sprintf('%4d%2d%2d', $sec, $min...);

Replies are listed 'Best First'.
Re: Re: Obtaining The Exact Time
by sauoq (Abbot) on Oct 08, 2002 at 00:24 UTC

    I agree that he should be more concerned with a unique value.

    However, he didn't say that he was forking and, even if he is, he may well be handling some setup prior to the fork.

    -sauoq
    "My two cents aren't worth a dime.";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://203534]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-20 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found