jovato
asked on
perl script date/time help needed in a major way
I have a script called tester.pl. I need a parameter created that is yearmonthdayhourminuteseco nd. I then need to use that parameter in the script to name a field and also to name the file as it is saved. I have asked this question in another EE section, but I am not getting very far. Any and all help is truely welcome as time is running out. Here is the tester.pl:
NOTE: The $currdate parameter at the end of the script is what I need to list out as yearmonthdayhourminuteseco nd.
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $q = new CGI;
print $q->header;
my %param = $q->Vars;
my $template = <<"EOF";
<html>
<head>
<title>cpconfig.com KB: $param{issue}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#FF0000" alink="#FF
0000">
<center>
<table width="600" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="600" height="550" valign="top">
<div align="center">
<p><b><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color=
"#999999"><br>
</font><font face="Fixedsys" size="6" color="#000000">cpconfig</ font></b
></p>
</div>
<div align="center">
<b><font face="Fixedsys" size="2">KnowledgeBase</fo nt></b></d iv>
<blockquote>
<div align="center">
<hr>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#99
9999"> |
<a href="#">cpconfig forum</a> | <a href="#">Home</a>
| <a href="#">Documentation</a> |
<a href="#">FAQ</a> | <a href="#">Links</a> | <a href="#">KB Help</a>
|</font><div align="left">
<hr>
<p>
<b><font face="Verdana" size="2">KBID</font></b>: </P>$currdate</font></P>
<font face="Verdana" size="2"><b>Issue:</b></fo nt>
<p><font face="Verdana" size="2">$param{issue}</fo nt></P>
<p><font face="Verdana" size="2"><b>Version:</b></ font></P>
<p><font face="Verdana" size="2">$param{version}</ font></P>
<font face="Verdana" size="2"><b>Platform:</b>< /font>
<p><font face="Verdana" size="2">$param{platform}< /font></P>
<p><font face="Verdana" size="2"><b>Abstract:</b>< /font></P>
<p><font face="Verdana" size="2">$param{abstract}< /font></P>
<font face="Verdana" size="2"><b>Solution:</b>< /font>
<p><font face="Verdana" size="2">$param{solution}< /font></P>
<p><font face="Verdana" size="2"><b>Links/Sources: </b></font ></P>
<p><font face="Verdana" size="2">$param{links}</fo nt></P>
<font face="Verdana" size="2"><b>Submitted By:</b></font>
<p><font face="Verdana" size="2">$param{submitted} </font></P >
<p> </p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" color="#999999
" size="1"><i>
DISCLAIMER: The
following information is believed to be accurate. If you find
anything wrong with any of the documentation, please e-mail us at
<a href="mailto:docs\@cpconfi g.com?subj ect=Knowle dgeBase problems">k
b\@cpconfig.com</a> and let us know. We take no responsibility for
the accuracy or completeness of the documentation here. As always,
please test everything in a lab environment and not in production.</
i></font></p>
<p> </p>
</div>
</div>
</blockquote>
</td>
</tr>
</table></center>
</body>
</html>
EOF
open (FILE, ">/usr/local/apache/htdocs /knowledge base/$curr date.html" ) or die "C
an not open $currdate.html $!\n";
print FILE $template;
close (FILE);
print "<h1>Created File</h1>";
exit;
NOTE: The $currdate parameter at the end of the script is what I need to list out as yearmonthdayhourminuteseco
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $q = new CGI;
print $q->header;
my %param = $q->Vars;
my $template = <<"EOF";
<html>
<head>
<title>cpconfig.com KB: $param{issue}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#FF0000" alink="#FF
0000">
<center>
<table width="600" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="600" height="550" valign="top">
<div align="center">
<p><b><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color=
"#999999"><br>
</font><font face="Fixedsys" size="6" color="#000000">cpconfig</
></p>
</div>
<div align="center">
<b><font face="Fixedsys" size="2">KnowledgeBase</fo
<blockquote>
<div align="center">
<hr>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#99
9999"> |
<a href="#">cpconfig forum</a> | <a href="#">Home</a>
| <a href="#">Documentation</a>
<a href="#">FAQ</a> | <a href="#">Links</a> | <a href="#">KB Help</a>
|</font><div align="left">
<hr>
<p>
<b><font face="Verdana" size="2">KBID</font></b>: </P>$currdate</font></P>
<font face="Verdana" size="2"><b>Issue:</b></fo
<p><font face="Verdana" size="2">$param{issue}</fo
<p><font face="Verdana" size="2"><b>Version:</b></
<p><font face="Verdana" size="2">$param{version}</
<font face="Verdana" size="2"><b>Platform:</b><
<p><font face="Verdana" size="2">$param{platform}<
<p><font face="Verdana" size="2"><b>Abstract:</b><
<p><font face="Verdana" size="2">$param{abstract}<
<font face="Verdana" size="2"><b>Solution:</b><
<p><font face="Verdana" size="2">$param{solution}<
<p><font face="Verdana" size="2"><b>Links/Sources:
<p><font face="Verdana" size="2">$param{links}</fo
<font face="Verdana" size="2"><b>Submitted By:</b></font>
<p><font face="Verdana" size="2">$param{submitted}
<p> </p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" color="#999999
" size="1"><i>
DISCLAIMER: The
following information is believed to be accurate. If you find
anything wrong with any of the documentation, please e-mail us at
<a href="mailto:docs\@cpconfi
b\@cpconfig.com</a> and let us know. We take no responsibility for
the accuracy or completeness of the documentation here. As always,
please test everything in a lab environment and not in production.</
i></font></p>
<p> </p>
</div>
</div>
</blockquote>
</td>
</tr>
</table></center>
</body>
</html>
EOF
open (FILE, ">/usr/local/apache/htdocs
an not open $currdate.html $!\n";
print FILE $template;
close (FILE);
print "<h1>Created File</h1>";
exit;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks again
$currdate = sprintf("%04d%02d%02d%02d%
$lt[5]+1900,$lt[4]+1,@lt[3