FW: [WEB4LIB] $date_command path in NT

Gimon, Charles A CAGimon at mpls.lib.mn.us
Tue Nov 28 17:00:43 EST 2000


(Non-perl people can feel free to ignore the following...)

You could have it shell out to NT to do 

date /t

which will output something like

Tue 11/28/2000

Note that this is different than "date" on Unix systems; on Solaris "date"
outputs

Tue Nov 28 14:52:54 CST 2000

In both cases it's shelling out to the OS and running a separate process to
get the date; a better (and platform-independent) choice would be to rework
that part of the script to use perl's own "time" and "localtime" functions,
or the Time::Local module.

You'll also need to look a little further down to see what the script does
with the $date_command variable. If it splits it into an array or does any
kind of editing to the string, you'll need to make appropriate adjustments
so it looks and behaves the way you want it to.

--Charles Gimon
  Web Coordinator
  Minneapolis Public Library

> -----Original Message-----
> From: David Merchant [mailto:merchant at LATECH.EDU] 
> Sent: Tuesday, November 28, 2000 3:33 PM
> To: Multiple recipients of list
> Subject: [WEB4LIB] $date_command path in NT
> 
> 
> I transfered a guestbook program from a Unix server to an NT 
> server.  I 
> found I had to alter the script a bit to work under NT, the remaining 
> problem I have is that while it now works it no longer has a 
> time stamp for 
> guestbook entries, I'm thinking it has something to do with this line:
> 
> $date_command = "/usr/bin/date";
> 
> But I'm not sure how to proceed from here?
> 
> TTFN,
> David
> Head, Systems Dept, Louisiana Tech University
> merchant at latech.edu
> JavaScript List Administrator (www.mountaindragon.com/javascript/)
> Webmaster, HTML Encyclopedia (www.mountaindragon.com/html/)
> Memorial Day Page: www.mountaindragon.com/memorial/
> 


More information about the Web4lib mailing list