Re: Date and Time and Function calls

2007-11-25 Thread Martin Barth
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

Re: Date and Time and Function calls

2007-11-25 Thread Dr.Ruud
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

Re: Date and Time and Function calls

2007-11-25 Thread rahed
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

Re: Date and Time and Function calls

2007-11-25 Thread Tom Phoenix
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

Re: Date and Time and Function calls

2007-11-25 Thread yitzle
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

Re: Date and time

2007-01-22 Thread M. Lewis
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

Re: Date and time

2007-01-21 Thread Rob Dixon
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

Re: Date and time

2007-01-21 Thread Dr.Ruud
"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

Re: Date and time

2007-01-21 Thread Goksie
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

Re: Date and time

2007-01-21 Thread Owen
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

Re: Date and time

2007-01-21 Thread John W. Krahn
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

RE: Date and Time Functions

2006-09-22 Thread Lee Goddard
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

Re: Date and Time Functions

2006-09-21 Thread Xavier Mas i Ramón
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"

Re: Date and Time Functions

2006-09-20 Thread Owen Cook
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

Re: Date and Time Functions

2006-09-20 Thread Jeff Pang
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-

Re: date and time in perl

2006-04-10 Thread nishanth ev
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

Re: date and time in perl

2006-04-10 Thread Dr.Ruud
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

Re: date and time in perl

2006-04-10 Thread Irfan J Sayed
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

Re: date and time in perl

2006-04-10 Thread Jeff Pang
>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

Re: date and time in perl

2006-04-10 Thread Irfan J Sayed
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

Re: date and time in perl

2006-04-10 Thread Chas Owens
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

Re: Date and time calculation

2004-06-17 Thread Chris Charley
> 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

RE: Date and time calculation

2004-06-16 Thread Tim Johnson
: Subject: Re: Date and time calculation Date::Calc Date::Manip DateTime All make this trivial.

Re: Date and time calculation

2004-06-16 Thread Wiggins d Anconia
> 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

Re: Date and time calculation

2004-06-16 Thread Werner Otto
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

Re: Date and time calculation

2004-06-16 Thread Wiggins d Anconia
> 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

Re: Date and Time

2004-01-23 Thread Owen
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

RE: Date and Time

2004-01-22 Thread Tim Johnson
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

Re: Date and time modified

2002-09-09 Thread Paul Johnson
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

Re: Date and time modified

2002-09-09 Thread drieux
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]

Re: teaching examples (was "Re: Date and Time")

2002-07-15 Thread Peter Scott
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

Re: teaching examples (was "Re: Date and Time")

2002-07-15 Thread David T-G
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

Re: teaching examples (was "Re: Date and Time")

2002-07-13 Thread drieux
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

Re: teaching examples (was "Re: Date and Time")

2002-07-13 Thread David T-G
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!

Re: Date and Time

2002-07-12 Thread Peter Scott
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

Re: Date and Time

2002-07-12 Thread David T-G
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

Fw: Re: Date and Time

2002-07-11 Thread jffusion
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

Re: Date and Time

2002-07-11 Thread zentara
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

RE: Date and Time

2002-07-10 Thread Timothy Johnson
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

RE: Date and Time

2002-07-10 Thread Peter Scott
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

RE: Date and Time

2002-07-10 Thread Kipp, James
> > 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

Re: Date and Time

2002-07-10 Thread jffusion
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

Re: Date and Time

2002-07-10 Thread Janek Schleicher
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

Re: Date and Time

2002-07-10 Thread Felix Geerinckx
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,

Re: Date and Time

2002-07-09 Thread Connie Chan
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

Re: Date and Time

2002-07-09 Thread victor
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

Re: Date and time.

2002-01-04 Thread Jon Molin
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.

Re: date and time

2001-08-16 Thread register
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