Hi Andrew,
I would suggest http://search.cpan.org/~tjenness/File-Temp-0.19/Temp.pm
HTH Martin
On Sat, 24 Nov 2007 08:44:18 -0800
AndrewMcHorney <[EMAIL PROTECTED]> wrote:
> Hello
>
> I am looking for a perl function or functions that will give me the
> date and time. I am going to use the r
rahed schreef:
> AndrewMcHorney:
>> I am looking for a perl function or functions that will give me the
>> date and time. I am going to use the results to create a unique file
>> name.
>
> There are many posibilities depending on uniqueness,
> this is quite similar:
>
> $randnum = 1000 + int r
AndrewMcHorney <[EMAIL PROTECTED]> writes:
> Hello
>
> I am looking for a perl function or functions that will give me the
> date and time. I am going to use the results to create a unique file
> name.
There are many posibilities depending on uniqueness,
this is quite similar:
$randnum = 1000
On 11/24/07, AndrewMcHorney <[EMAIL PROTECTED]> wrote:
> I am looking for a perl function or functions that will give me the
> date and time.
Are you looking in the perlfunc manpage? Type 'perldoc perlfunc' at a
prompt (or into your favorite search engine) to get started.
> I am going to use t
time will give you the number of seconds since the epoch. This is good
so long as you don't expect to create two files in one second.
http://perldoc.perl.org/functions/time.html
"For measuring time in better granularity than one second, you may use
either the Time::HiRes module (from CPAN, and sta
Rob Dixon wrote:
M. Lewis wrote:
>
> Given the following code, if I were to want $day, $month, $hour, $minute
> & $sec to have a leading zero (ie 01 for Jan rather than 1), is my only
> option to use printf? Or is there a better way.
>
> What I'm searching for here is the *correct* method
M. Lewis wrote:
>
> Given the following code, if I were to want $day, $month, $hour, $minute
> & $sec to have a leading zero (ie 01 for Jan rather than 1), is my only
> option to use printf? Or is there a better way.
>
> What I'm searching for here is the *correct* method to get $day, $month,
> et
"M. Lewis" schreef:
> if I were to want $day, $month, $hour,
> $minute & $sec to have a leading zero (ie 01 for Jan rather than 1),
> is my only option to use printf? Or is there a better way.
>
> What I'm searching for here is the *correct* method to get $day,
> $month, etc for uses like naming
M. Lewis wrote:
>
> Given the following code, if I were to want $day, $month, $hour,
> $minute & $sec to have a leading zero (ie 01 for Jan rather than 1),
> is my only option to use printf? Or is there a better way.
>
> What I'm searching for here is the *correct* method to get $day,
> $month, etc
On Sun, 21 Jan 2007 02:17:08 -0500
"M. Lewis" <[EMAIL PROTECTED]> wrote:
>
> Given the following code, if I were to want $day, $month, $hour, $minute
> & $sec to have a leading zero (ie 01 for Jan rather than 1), is my only
> option to use printf? Or is there a better way.
Look at sprintf
pe
M. Lewis wrote:
>
> Given the following code, if I were to want $day, $month, $hour, $minute
> & $sec to have a leading zero (ie 01 for Jan rather than 1), is my only
> option to use printf? Or is there a better way.
>
> What I'm searching for here is the *correct* method to get $day, $month,
> e
Xavier Mas i Ramón [mailto:[EMAIL PROTECTED] :
> A Dijous 21 Setembre 2006 01:38, [EMAIL PROTECTED] va escriure:
>
> > I am looking for some simple perl functions that will return the
> > current date and time in string format. The purpose is to create a
> > file with part of the name being the d
A Dijous 21 Setembre 2006 01:38, [EMAIL PROTECTED] va escriure:
> Hello
>
> I am looking for some simple perl functions that will return the current
> date and time in string format. The purpose is to create a file with part
> of the name being the date and time.
>
> Thanks,
> Andrew
sytem "date"
On Wed, 20 Sep 2006 [EMAIL PROTECTED] wrote:
> Hello
>
> I am looking for some simple perl functions that will return the current date
> and time in string format. The purpose is to create a file with part of the
> name being the date and time.
I use something like this
Hi,
Many of the functions exist on CPAN.One of them is 'strftime' which is coming
from POSIX.
use POSIX 'strftime';
print strftime "%Y-%m-%d",localtime;
__END__
You'll get:
2006-09-21
As the same effect as the unix command of 'date +%Y-%m-%d' 's output.
Hope it helps.
-Original Message-
Hello,
Use this code according to your requirement.
#!/usr/bin/perl
$no=`date`;
print $no;
Regards
Nish
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
To unsubscribe, e-mail: [EMAI
Irfan J Sayed schreef:
> Can you tell me exact command / syntax [...]
> so that i can store date,time in some variable.
See:
perldoc -f localtime
http://perlmeme.org/faqs/datetime/
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional co
Thanks Jelf
Regards
Irfan Sayed
Jeff Pang <[EMAIL PROTECTED]>
04/10/2006 06:11 PM
Please respond to
Jeff Pang <[EMAIL PROTECTED]>
To
beginners@perl.org
cc
Subject
Re: date and time in perl
>Hi,
>
>Can you tell me exact command / syntax as i struggled lot bu
>Hi,
>
>Can you tell me exact command / syntax as i struggled lot but didn't
>succeed so that i can store date,time in some variable.
>
Hi,you can use the 'strftime' which is coming from POSIX to get your time
format similar to Unix shell command.
for example,you could write:
use POSIX qw(str
cc
beginners@perl.org
Subject
Re: date and time in perl
On 4/1/06, Irfan J Sayed <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> How to get date and time in perl ? is there any function for that ?
>
> Regards
> Irfan Sayed
localtime() returns the current time in your timezone
On 4/1/06, Irfan J Sayed <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> How to get date and time in perl ? is there any function for that ?
>
> Regards
> Irfan Sayed
localtime() returns the current time in your timezone. When called in
scalar context it returns a string representation of the date and
t
> Hi there,
>
> I've got a date field and a time field, how can I effectively subtract the
> field ($date $time) - ($date2 $time2) from each other. I am using these
> two fields to determine a server's uptime according to my database in
> days,hours,minutes,seconds.
> Kind Regards,
> Werner Otto
P
:
Subject: Re: Date and time calculation
Date::Calc
Date::Manip
DateTime
All make this trivial.
> According to perldoc.
>
> Date_to_Time:
> $time = Date_to_Time($year,$month,$day, $hour,$min,$sec);
>
> Here I can go print $time and get the value
>
> Time_to_Date:
> ($year,$month,$day, $hour,$min,$sec) = Time_to_Date([time]);
>
> How do I see the value converted back to the dat
According to perldoc.
Date_to_Time:
$time = Date_to_Time($year,$month,$day, $hour,$min,$sec);
Here I can go print $time and get the value
Time_to_Date:
($year,$month,$day, $hour,$min,$sec) = Time_to_Date([time]);
How do I see the value converted back to the date as it was?
Hi there,
I've got
> Hi there,
>
> I've got a date field and a time field, how can I effectively subtract
the
> field ($date $time) - ($date2 $time2) from each other. I am using these
> two fields to determine a server's uptime according to my database in
> days,hours,minutes,seconds. I have read numourous articl
On Thu, 22 Jan 2004 17:06:58 -0800
"Larry Guest" <[EMAIL PROTECTED]> wrote:
>
> But rsync does not know how to handle this string, I think when its
> passed to rsync its not text as I see it on the screen. It cant make
> the dir and pukes.
>
> I have seen a bunch of stuff out there for sprintf
You should check out the localtime() function in Perl. That way you can
be sure of what you are sending to your program.
perldoc -f localtime
-Original Message-
From: Larry Guest [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 5:07 PM
To: 'Perl Beginners Mailing List'
Subj
On Fri, Aug 09, 2002 at 06:13:41PM +0200, Quincy Ntuli wrote:
> Greetings.
>
> I wish to obtain the time and date of a file.
>
> How do i do this in perl ?
perldoc -f stat
perldoc -f -X
> There is probably a module out there to do this but is it possible to
> modify the date and time format o
On Friday, Aug 9, 2002, at 09:13 US/Pacific, Quincy Ntuli wrote:
> Greetings.
>
> I wish to obtain the time and date of a file.
>
> How do i do this in perl ?
perldoc -f stat
ciao
drieux
---
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
At 09:13 AM 7/15/02 -0500, David T-G wrote:
>I *think* I understand this.
>
> - 'my' defines a var for only this block and does not export to
> subroutines
Correct, although 'export' is the wrong term. This is why these are
called 'lexical' variables; their scope is lexically defined (as
drieux, et al --
...and then drieux said...
%
% On Saturday, July 13, 2002, at 07:11 , David T-G wrote:
%
% In the main I like where this is generally going.
Yay :-)
%
% A part of my argument with myself today has been about
%
% which is better? all 'teaching code' should be 'virgin
On Saturday, July 13, 2002, at 07:11 , David T-G wrote:
In the main I like where this is generally going.
A part of my argument with myself today has been about
which is better? all 'teaching code' should be 'virgin clean'???
or should we show the actual process by which ideas
Peter, et al --
...and then Peter Scott said...
%
% At 11:18 AM 7/12/02 -0500, David T-G wrote:
% >
% >...and then Peter Scott said...
% >%
...
% >% possible. Later on I show the beginners a nasty example of the
% >% consequences of leaving out use strict, -w/use warnings, or both.
% >
% >Oooh!
At 11:18 AM 7/12/02 -0500, David T-G wrote:
>Peter, et al --
>
>...and then Peter Scott said...
>%
>...
>% code. (Yes, IMHO, if you insist.) My students see it in every program
>% I show them, from Hello World onward. I tell them that if anyone gives
>% them code without it to maintain, they sh
Peter, et al --
...and then Peter Scott said...
%
...
% code. (Yes, IMHO, if you insist.) My students see it in every program
% I show them, from Hello World onward. I tell them that if anyone gives
% them code without it to maintain, they should refuse if at all
% possible. Later on I sh
first off let me say thank you for the help
I know I am a pest, but I am learning a lot
Anyway I fixed everything so it works fine in my editor
However now it refuses to work in my browser.
I keep getting an error 500
Which I can only assume is because of my html header.
I checked the subject in
On Wed, 10 Jul 2002 11:52:55 -0400, [EMAIL PROTECTED] wrote:
>This is what I have now.
>...
>The only problem seems to be the
>use strict; directive
>if I take this out it works fine
>
>So I guess I need to know if the use strict; directive is really
>necessary and if so how do I get around
wday,$yday,$isdst) = localtime(time);
-Original Message-
From: Kipp, James [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 10, 2002 9:46 AM
To: [EMAIL PROTECTED]
Subject: RE: Date and Time
>
> The only problem seems to be the
> use strict; directive
> if I take this out i
At 12:46 PM 7/10/02 -0400, Kipp, James wrote:
> >
> > The only problem seems to be the
> > use strict; directive
> > if I take this out it works fine
> >
> > So I guess I need to know if the use strict; directive is really
> > necessary and if so how do I get around it?
>
>either take it out or
>
> The only problem seems to be the
> use strict; directive
> if I take this out it works fine
>
> So I guess I need to know if the use strict; directive is really
> necessary and if so how do I get around it?
either take it out or declare ALL of your variables.
--
To unsubscribe, e-m
This is what I have now.
#!C:/Perl/bin/perl.exe -w
###
# Written by William S. Lyles
# July 9 2002
#
# The purpose of this program
# is to generate a random username
# and password, then write the
# username and password to a
# database file and .htpasswd file
# an
jffusion wrote at Wed, 10 Jul 2002 04:57:25 +0200:
> I'm trying to get my script to recognize the date and time. I thought I had it but I
>keep getting
> errors all over.
> ...
> sub get_date {
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
> localtime(time);
> @month
on Tue, 09 Jul 2002 22:12:52 GMT, [EMAIL PROTECTED] wrote:
> I'm trying to get my script to recognize the date and time.
> I thought I had it but I keep getting errors all over.
>
> Please take a look and tell me whats wrong
> [...]
> sub get_date {
> ($sec,$min,$hour,$mday,$mon,$year,$wday,
Do you want$date = "@months[$mon]/$mday/$year";
or $date = "$months[$mon]/$mday/$year";
Rgds,
Connie
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 10, 2002 10:57 AM
Subject: Date and Time
>
> Hi
>
> I'm trying to get my script t
are you trying to get the localtime in readable format? if so try this
print scalar(localtime);
Tor.
[EMAIL PROTECTED] wrote:
>
> Hi
>
> I'm trying to get my script to recognize the date and time.
> I thought I had it but I keep getting errors all over.
>
> Please take a look and tell me
Mark-Nathaniel Weisman wrote:
>
> Hello all,
> Sorry about re-hashing old things here, however I've looked through
> the older messages and can't seem to come up with an answer. How can you
> pull a server based date and time stamp from within a script? Any help
> would be greatly appreciated.
Wothout code and the format of the log file I can only suggest this ... others
might have other ideas ..
You could read in the line and try to split on the line to put the list
elements into a hash ... the key of hte hash would be the converted time/date
stamp in epoch then you can loop thro
48 matches
Mail list logo