newbie01 perl newbie01.p...@gmail.com wrote:
Problem 1:
- Is there a function to compare the two (2) dates so ensure that I
will always be doing future_date-past_date? At the moment, the
workaround that am doing is if I get a negative value, then that
means, I've done a past_date-future_date
any additional modules as the UNIX SA said no, no, no, no
gr ... I don't have DateTime or Date::Manip either. I don't know what
Date or Time modules are installed on the server. Is there a way to check
what modules are available/installed on the Perl install?
- Anyway, question is can
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.
Andrew
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
function or functions that will give me the
date and time. I am going to use the results to create a unique file name.
Andrew
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
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
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 + int
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 rand(9000
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
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 to
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 for
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
perldoc -f
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 for
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 backup
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 for
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 for uses like naming
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 date
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 spits out
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
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
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
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
-
From: [EMAIL PROTECTED]
Sent: Sep 21, 2006 7:38 AM
To: beginners@perl.org
Subject: Date and Time Functions
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
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
Hi All,
How to get date and time in perl ? is there any function for that ?
Regards
Irfan Sayed
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
time
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.
plz let me know.
Regards
Irfan Sayed
Chas Owens [EMAIL PROTECTED]
04/10/2006 03:38 PM
To
Irfan J Sayed/India/[EMAIL PROTECTED]
cc
beginners@perl.org
Subject
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
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 but didn't
succeed so that i
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
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:
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
Perhaps
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 articles and posts
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 articles
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 articles and posts on
suggestions
as it was?
I don't understand what you are asking. ??
http://danconia.org
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
:
Subject: Re: Date and time calculation
snip
Date::Calc
Date::Manip
DateTime
All make this trivial.
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, etc
I am calling rsync from my perl script. When it runs it creates a dir
where I want the backups to go. I need this dir to be the current
date-time.
I can get the format I want like this.
my $date = `date +%m-%d-%Y_%H-%M-%S`;
Which gives me
01-22-2004_20-04-14
But rsync does
'
Subject: Date and Time
I can get the format I want like this.
my $date = `date +%m-%d-%Y_%H-%M-%S`;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Greetings.
I wish to obtain the time and date of a file.
How do i do this in perl ?
There is probably a module out there to do this but is it possible to modify the date
and time format of the output of whatever method is available for getting the time and
date modified for a file ?
thanx
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]
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
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
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 in,
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!
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...
%
...
% 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
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 should
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 it?
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
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 whats wrong
Thanks
# Here we define the variables
use strict;
my $htpasswd = 'c:\apache\htdocs\members\.htpasswd';
my $database = 'c:\apache
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 whats wrong
Thanks
# Here we define the variables
use strict;
my $htpasswd = 'c:\apache\htdocs\members\.htpasswd';
my $database = 'c:\apache
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 whats
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 to recognize
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,$yday
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
#
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-mail:
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 declare ALL of
,$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 it works fine
So I guess I
Hi all,
I thought getting the date would be like how it's in a shell script `date` but it does
not seem to be working. Could someone please advise me on this I tried searching
archives on date but didn't get anything useful. It's possible I'm looking in the
wrong place.
Thanks in advance
.
Don't use the shell. Perl provides you with the localtime() and
time() functions.
perldoc -f localtime
perldoc -f time
Perhaps if you tell us what format you want the date and time in, we could
be of more service. But even before you ask us that, I direct your
attention to the POSIX
On Wednesday, June 12, 2002, at 10:46 , Leila Lappin wrote:
[..]
I thought getting the date would be like how it's in a shell script `date`
but it does not seem to be working. Could someone please advise me on
this I tried searching archives on date but didn't get anything useful.
It's
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.
Thank you,
Mark-Nathaniel Weisman A+, MCP
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
Hi,
I am new with Perl
if someone can help me out
I wrote a script which reads two files and compares them and then prints out
what is missing
but since the txt files are kind of log files they have time and date column
in it
what i want is to out put only 2 hours old log after comparing
how can
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
64 matches
Mail list logo