Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Calling Windows "time /t" command

by Corion (Patriarch)
on Jul 27, 2006 at 14:43 UTC ( [id://564117]=note: print w/replies, xml ) Need Help??


in reply to Calling Windows "time /t" command

It sounds that on "one or two" of your servers, there is a program time.exe installed, most likely from the Cygwin suite of programs, which preempts the shell builtin time command.

To solve your problem, maybe you want to look at the Perl builtin functions of localtime and gmtime() together with the POSIX::strftime() function:

use strict; use warnings; use POSIX qw(strftime); print strftime "%Y:%m:%d %H:%M:%S", localtime();

There are lots of format strings that strftime knows to insert into your string, like the weekday and more, should you need it.

Replies are listed 'Best First'.
Re^2: Calling Windows "time /t" command
by sgifford (Prior) on Jul 27, 2006 at 15:17 UTC
    Another solution would be to alter your PATH environment variable to make sure the system's time command comes before any others.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2024-04-19 15:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found