Re: Wanted: Help performing Date-Time Arithmetic using emacs/vi and perl

2016-04-19 Thread Shlomi Fish
); $date)="" Can > someone help me figure out how to use the eval function in my perl one-liner > to evaluate date time arithmetic? Thanks,Siegfried > This is the Perl beginners mailing list and we aim to help beginners with beginners question while encouraging best practices and

Wanted: Help performing Date-Time Arithmetic using emacs/vi and perl

2016-04-18 Thread Richard Heintze via beginners
: (use Date::Calc ( ":all" ); use Date::Manip; my ( $date, $yy, $dd, $mm ); $date = scalar localtime( ( time() - ( 24 * 60 * 60 ) ) ); $date)="" Can someone help me figure out how to use the eval function in my perl one-liner to evaluate date time arithmetic? Thanks,Siegfried

Re: Rounding Date/Time

2011-05-06 Thread Peter Scott
On Mon, 02 May 2011 11:46:42 -0500, Matt wrote: > Have a date: > > 2011-05-02-16:40:51 [...] > > I need to round it to nearest 5 minute point. > > 2011-05-02-16:40:51 If you care about things like daylight savings time adjustments, calendar changes, or leap seconds, the answer requires consid

Re: Rounding Date/Time

2011-05-05 Thread Pete Smith
On May 2, 9:46 am, lm7...@gmail.com (Matt) wrote: Have a date: 2011-05-02-16:40:51 Using this to get it: $tm = gmtime; $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec; print "$time_stamp\n"; I need to r

Re: Rounding Date/Time

2011-05-04 Thread Rob Dixon
On 04/05/2011 18:14, C.DeRykus wrote: On May 3, 4:12 pm, rob.di...@gmx.com (Rob Dixon) wrote: On 03/05/2011 19:49, C.DeRykus wrote: use Time::localtime; use List::Util qw/reduce/; my @rounded_5mins = grep { not $_ % 5 } 0..60; my $curr_min = localtime->min; my $round_min = reduce { $curr_mi

Re: Rounding Date/Time

2011-05-04 Thread C.DeRykus
On May 3, 4:12 pm, rob.di...@gmx.com (Rob Dixon) wrote: > On 03/05/2011 19:49, C.DeRykus wrote: > > > > > > > > > > > On May 2, 9:46 am, lm7...@gmail.com (Matt) wrote: > >> Have a date: > > >> 2011-05-02-16:40:51 > > >> Using this to get it: > > >> $tm = gmtime; > >> $time_stamp = sprintf "%04d-%02

Re: Rounding Date/Time

2011-05-03 Thread Rob Dixon
On 03/05/2011 19:49, C.DeRykus wrote: On May 2, 9:46 am, lm7...@gmail.com (Matt) wrote: Have a date: 2011-05-02-16:40:51 Using this to get it: $tm = gmtime; $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec; print

Re: Rounding Date/Time

2011-05-03 Thread C.DeRykus
On May 3, 11:54 am, shawnhco...@ncf.ca (Shawn H Corey) wrote: > On 11-05-03 02:49 PM, C.DeRykus wrote: > > > my @rounded_5mins = grep { not $_ % 5 } 0..60; > > my @rounded_5mins = map { $_ * 5 } 0..12; > > # TIMTOWTDI > Make that: TIMTOWTDI++ # a much better way to do it -- Charles DeRykus -

Re: Rounding Date/Time

2011-05-03 Thread Shawn H Corey
On 11-05-03 02:49 PM, C.DeRykus wrote: my @rounded_5mins = grep { not $_ % 5 } 0..60; my @rounded_5mins = map { $_ * 5 } 0..12; # TIMTOWTDI -- Just my 0.0002 million dollars worth, Shawn Confusion is the first step of understanding. Programming is as much about organization and commu

Re: Rounding Date/Time

2011-05-03 Thread C.DeRykus
On May 2, 9:46 am, lm7...@gmail.com (Matt) wrote: > Have a date: > > 2011-05-02-16:40:51 > > Using this to get it: > > $tm = gmtime; > $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", >  $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec; > print "$time_stamp\n"; > > I n

Re: Rounding Date/Time

2011-05-03 Thread Rob Dixon
On 02/05/2011 17:46, Matt wrote: Have a date: 2011-05-02-16:40:51 Using this to get it: $tm = gmtime; $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec; print "$time_stamp\n"; I need to round it to nearest 5 minut

Re: Rounding Date/Time

2011-05-02 Thread Jim Gibson
day, $tm->hour, $tm->min, $tm->sec; > print "$time_stamp\n"; That program fragment does not run on my system: "Can't locate object method "year" via package "Mon May 2 17:16:09 2011" (perhaps you forgot to load "Mon May 2 17:16:09 2011&qu

Re: Rounding Date/Time

2011-05-02 Thread Uri Guttman
> "M" == Matt writes: M> Have a date: M> 2011-05-02-16:40:51 M> Using this to get it: M> $tm = gmtime; M> $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", M> $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec; M> print "$time_stamp\n"; use POSIX

Rounding Date/Time

2011-05-02 Thread Matt
Have a date: 2011-05-02-16:40:51 Using this to get it: $tm = gmtime; $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec; print "$time_stamp\n"; I need to round it to nearest 5 minute point. 2011-05-02-16:40:51 needs

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread Jim Gibson
lay the timestamp, i.e. date and > time, of the file. Then I want to compare it with today's date and display > the date/time difference in n days n hours n minutes. If the file is more > than 2 days old, that should mean that the backup did not run so I have to > send an email notif

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread Shawn H Corey
On 11-03-02 12:31 PM, shawn wilson wrote: Seems like more of a pain for a modest gain in speed to me. I like find and dt because its quick and easy. Either way though. No, because you don't have to worry about daylight-savings time or switching time zones. Seconds from the epoch is the same o

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread shawn wilson
On Mar 2, 2011 12:16 PM, "Shawn H Corey" wrote: > > On 11-03-02 12:12 PM, shawn wilson wrote: >> >> First, use File::Find to get your info (or you could use system( ls -l ) and >> split - either way). To compare your time stamps, use DateTime and do dt1 - >> dt2 >> > > No. If you can do all your

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread Shawn H Corey
On 11-03-02 12:12 PM, shawn wilson wrote: First, use File::Find to get your info (or you could use system( ls -l ) and split - either way). To compare your time stamps, use DateTime and do dt1 - dt2 No. If you can do all your calculations using seconds from the epoch, then do so. Only conve

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread shawn wilson
First, use File::Find to get your info (or you could use system( ls -l ) and split - either way). To compare your time stamps, use DateTime and do dt1 - dt2

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread Shawn H Corey
On 11-03-02 11:34 AM, newbie01 perl wrote: My main hurdle is the file timestamp and date arithmetic part. Frm Google'ing, am leaning towards using stat which am hoping will work on both Unix and Windows. Some guidance will be much appreciated. Thanks in advance. Use the stat function to get th

Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread newbie01 perl
the script to check the most recent file in a backup directory, i.e. newest, for example /backup/file.33 and display the timestamp, i.e. date and time, of the file. Then I want to compare it with today's date and display the date/time difference in n days n hours n minutes. If the file is more t

Re: class DBI postgres date time format

2009-03-17 Thread Dermot
2009/3/17 ken uhl : > How do I set up table class method to correctly format and write 'updated' >  column  date and time stamp to postgres? > > I have table entry object that contains this - to inflate and deflate : > > I think I need to add  "has_timestamp" > . > >    22 __PACKAGE__->table('d

class DBI postgres date time format

2009-03-17 Thread ken uhl
How do I set up table class method to correctly format and write 'updated' column date and time stamp to postgres? I have table entry object that contains this - to inflate and deflate : I think I need to add "has_timestamp" . 22 __PACKAGE__->table('dhcpmac'); 23 __PACKAGE__-

Re: Need help with date-time and output

2007-11-26 Thread Gerald Wheeler
One additional note: The input data, column one has values 1 to 365(6) Thanks J. >>> "Gerald Wheeler" <[EMAIL PROTECTED]> 11/26/2007 9:40 AM >>> I am getting and error: Day '32" out of range 1..31 at ... line 35 for this line: my ( $d, $m, $y ) = ( localtime timelocal 0, 0, 12, $_, 0, $dyr )

Re: Need help with date-time and output

2007-11-26 Thread Gerald Wheeler
I am getting and error: Day '32" out of range 1..31 at ... line 35 for this line: my ( $d, $m, $y ) = ( localtime timelocal 0, 0, 12, $_, 0, $dyr )[ 3, 4, 5 ]; and I don't quite know why.. The value for "$_" should be reset to 1 after Jan 31st.. Output is created through only January 31 Thank

Re: Need help with date-time and output

2007-11-22 Thread Gerald Wheeler
Thanks I'll try in.. J. >>> John W.Krahn <[EMAIL PROTECTED]> 11/21/07 9:26 PM >>> On Wednesday 21 November 2007 09:40, Gerald Wheeler wrote: > John, > I have modified my script as per your suggestions: > > > #!/usr/bin/perl > > use strict; > use warnings; > > my $ifiln = 'abc.csv'; > my $ofiln = '

Re: Need help with date-time and output

2007-11-21 Thread John W . Krahn
On Wednesday 21 November 2007 09:40, Gerald Wheeler wrote: > John, > I have modified my script as per your suggestions: > > > #!/usr/bin/perl > > use strict; > use warnings; > > my $ifiln = 'abc.csv'; > my $ofiln = 'xyz.txt'; > > # get start year () from command line > my($rsvr, $rdt, $dyr) = @

Re: Need help with date-time and output

2007-11-21 Thread Gunnar Hjalmarsson
Gerald Wheeler wrote: Gunnar Hjalmarsson wrote: use Time::Local; sub nextday { my ($y, $m, $d) = split /\//, shift; my $t = timegm 0, 0, 0, $d, $m-1, $y; ($d, $m, $y) = ( gmtime($t+24*60*60) )[3..5]; sprintf '%d/%02d/%02d', $y+1900, $m+1, $d; }

Re: Need help with date-time and output

2007-11-21 Thread Tom Phoenix
On 11/21/07, Gerald Wheeler <[EMAIL PROTECTED]> wrote: > It appears that Date::Calc would do what I need only I do not have > access to additional modules You don't need to be the system administrator to install modules. See the perlmodinstall manpage. http://perldoc.perl.org/perlmodinstall.

Re: Need help with date-time and output

2007-11-21 Thread Gerald Wheeler
I checked and find that I do have the Time::Local module installed The problem is ... how do I increment the day from start to end of the calendar year? If i initially set nextday to: 2007/01/01 how do i easily increment this? It appears that Date::Calc would do what I need only I do not have acces

Re: Need help with date-time and output

2007-11-21 Thread Gerald Wheeler
Gunnar, I checked and find that I do have the Time::Local module installed The problem is ... how do I increment the day from start to end of the calendar year? If i initially set nextday to: 2007/01/01 how do i easily increment this? Thanks >>> Gunnar Hjalmarsson <[EMAIL PROTECTED]> 11/20/2

Re: Need help with date-time and output

2007-11-21 Thread Gerald Wheeler
John, I have modified my script as per your suggestions: ** ++ chomp() returns the number of $/ values that were removed from its argument(s) so that is not what you want to do here. You should probably have chomped the data when you input it. ++ I am attempting to remove the newline character at

Re: Need help with date-time and output

2007-11-21 Thread Gerald Wheeler
First off thanks for the assistance See inline comments: >>> John W.Krahn <[EMAIL PROTECTED]> 11/20/2007 4:31:01 PM >>> On Tuesday 20 November 2007 14:00, Gerald Wheeler wrote: > Running Perl 5.6.1 on Solaris 9 SPARC > No (access to) modules available other than what comes with the basic > perl i

Re: Need help with date-time and output

2007-11-20 Thread Tom Phoenix
On 11/20/07, Eric Krause <[EMAIL PROTECTED]> wrote: > I think he can't download modules. I think he *thinks* he can't download modules. Cheers! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.

Re: Need help with date-time and output

2007-11-20 Thread Gunnar Hjalmarsson
Tom Phoenix wrote: On 11/20/07, Gerald Wheeler <[EMAIL PROTECTED]> wrote: No (access to) modules available other than what comes with the basic perl installation. *** I do NOT know how to increment (and format as "2007/01/01") date so that it crosses over for each new month and know when it is

Re: Need help with date-time and output

2007-11-20 Thread John W . Krahn
On Tuesday 20 November 2007 14:00, Gerald Wheeler wrote: > Running Perl 5.6.1 on Solaris 9 SPARC > No (access to) modules available other than what comes with the basic > perl installation. > > I have a file: ifiln.csv as such: > Julian Day of the year, value > 1,4144.34 > 2,4144.38 > 3,4144.38 [

Re: Need help with date-time and output

2007-11-20 Thread Tom Phoenix
On 11/20/07, Gerald Wheeler <[EMAIL PROTECTED]> wrote: > Running Perl 5.6.1 on Solaris 9 SPARC > No (access to) modules available other than what comes with the basic > perl installation. > *** I do NOT know how to increment (and format as "2007/01/01") date so > that it crosses over for each new

Need help with date-time and output

2007-11-20 Thread Gerald Wheeler
Running Perl 5.6.1 on Solaris 9 SPARC No (access to) modules available other than what comes with the basic perl installation. I have a file: ifiln.csv as such: Julian Day of the year, value 1,4144.34 2,4144.38 3,4144.38 4,4144.38 5,4144.44 6,4144.48 7,4144.48 8,4144.50 9,4144.50 10,4144.48 11,41

RE: Using Perl Win 32 AS 5.8.x - Anyway to find the File Create Date/Time

2007-09-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Rob Dixon [mailto:[EMAIL PROTECTED] > Sent: Monday, September 17, 2007 18:42 > To: beginners@perl.org > Subject: Re: Using Perl Win 32 AS 5.8.x - Anyway to find the > File Create Date/Time > > Wagner, David --- Senior Programm

Re: Using Perl Win 32 AS 5.8.x - Anyway to find the File Create Date/Time

2007-09-17 Thread Rob Dixon
Wagner, David --- Senior Programmer Analyst --- WGO wrote: stat will give me the mod time, but does not have the create time. From Windows Explorer, I notice that I can get the Create Date. Anyway to accomplish this in Perl? I did a search against CPAN and also AS, but what I pu

RE: Using Perl Win 32 AS 5.8.x - Anyway to find the File Create Date/Time

2007-09-17 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Jenda Krynicky [mailto:[EMAIL PROTECTED] > Sent: Monday, September 17, 2007 15:42 > To: beginners@perl.org > Subject: Re: Using Perl Win 32 AS 5.8.x - Anyway to find the > File Create Date/Time > > From: "Wagner, David --- Seni

Re: Using Perl Win 32 AS 5.8.x - Anyway to find the File Create Date/Time

2007-09-17 Thread Jenda Krynicky
From: "Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]> > stat will give me the mod time, but does not have the create > time. From Windows Explorer, I notice that I can get the Create Date. perldoc -f stat stat FILEHANDLE stat EXPR statReturns a 13-ele

Using Perl Win 32 AS 5.8.x - Anyway to find the File Create Date/Time

2007-09-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
stat will give me the mod time, but does not have the create time. From Windows Explorer, I notice that I can get the Create Date. Anyway to accomplish this in Perl? I did a search against CPAN and also AS, but what I put in ( Perl create time file ) did not seem to give me what I

RE: Date Time

2006-07-12 Thread Timothy Johnson
L PROTECTED] Sent: Wednesday, July 12, 2006 1:10 AM To: beginners@perl.org Subject: Date Time Hi, I got a file with this line: 200607081000@@01510 It means Datetime@@Values I'm trying to insert this in Mysql with fields terminated by `@@`'; It's works fine but i got the w

Re: Date Time

2006-07-12 Thread John W. Krahn
Semiyi.Abiola wrote: > Hi, Hello, > I got a file with this line: > > > 200607081000@@01510 > > It means Datetime@@Values > > I'm trying to insert this in Mysql with fields terminated by `@@`'; > > It's works fine but i got the wrong Datetime. > How kann i change 200607081000

Date Time

2006-07-12 Thread Semiyi.Abiola
Hi, I got a file with this line: 200607081000@@01510 It means Datetime@@Values I'm trying to insert this in Mysql with fields terminated by `@@`'; It's works fine but i got the wrong Datetime. How kann i change 200607081000 into 2006-07-08 10:00

Re: date & time from server problem/question

2006-05-17 Thread John W. Krahn
Graeme McLaren wrote: > Hi there, I decided that it would be a good idea to 'touch' the file > immediately after creating it and changing the modified date to the > current date, however its just not working for me. > > > change file permissions and 'touch' the file: > > system("chmod 777 "filep

Re: date & time from server problem/question

2006-05-17 Thread Graeme McLaren
nd Sub From: "Graeme McLaren" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] CC: beginners@perl.org Subject: Re: date & time from server problem/question Date: Wed, 17 May 2006 09:30:59 +0100 MIME-Version: 1.0 X-Originating-IP: [62.254.183.162] X-Originating-Email: [EM

Re: date & time from server problem/question

2006-05-17 Thread Graeme McLaren
gle-Sender-Auth: dfce7076203d905a Return-Path: [EMAIL PROTECTED] X-OriginalArrivalTime: 11 May 2006 17:43:26.0571 (UTC) FILETIME=[684AD3B0:01C67522] On 5/11/06, Graeme McLaren <[EMAIL PROTECTED]> wrote: Hi all, I'm trying to get the date & time a file was created on the server, I

RE: date & time from server problem/question

2006-05-11 Thread Timothy Johnson
If the server is a Windows server you can use the Win32::FileTime module to get the info you need. -Original Message- From: Graeme McLaren [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 9:55 AM To: beginners@perl.org Subject: date & time from server problem/question Hi

Re: date & time from server problem/question

2006-05-11 Thread Tom Phoenix
On 5/11/06, Graeme McLaren <[EMAIL PROTECTED]> wrote: Hi all, I'm trying to get the date & time a file was created on the server, I RTFM and I found: 10 ctimeinode change time (NOT creation time!) in seconds since the epoch It looks as if you've found the correct

date & time from server problem/question

2006-05-11 Thread Graeme McLaren
Hi all, I'm trying to get the date & time a file was created on the server, I RTFM and I found: 10 ctimeinode change time (NOT creation time!) in seconds since the epoch http://www.xav.com/perl/lib/Pod/perlfunc.html#item_stat How can I get the date & time of files fr

RE: How to change the date/time of PC

2005-08-17 Thread Timothy Johnson
OTECTED] Sent: Wednesday, December 17, 2003 4:59 PM To: beginners@perl.org Subject: How to change the date/time of PC Hi, I can't find any perl function to change the date/time of PC. The only way I found is `cmd.exe /C date $today`, call DOS function. Any one can give me a clue? Thanks,

Re: How to change the date/time of PC

2005-08-17 Thread Binish A R
Xiaofang Zhou wrote: Hi, I can't find any perl function to change the date/time of PC. The only way I found is `cmd.exe /C date $today`, call DOS function. Any one can give me a clue? Thanks, Xiaofang Zhou [EMAIL PROTECTED] I don't think there i

How to change the date/time of PC

2005-08-17 Thread Xiaofang Zhou
Hi, I can't find any perl function to change the date/time of PC. The only way I found is `cmd.exe /C date $today`, call DOS function. Any one can give me a clue? Thanks, Xiaofang Zhou [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

Re: How to figure date of Sunday? Favorite Date/Time packages

2005-06-18 Thread Paul Johnson
On Sat, Jun 18, 2005 at 05:45:24AM -0700, Peter Scott wrote: > On Sat, 18 Jun 2005 01:38:44 +0200, Paul Johnson wrote: > > Too much work! > > > > $ perl -MDate::Manip -le 'print UnixDate Date_GetPrev("today", "sun"), "%F"' > > Or even > > $ perl -MDate::Manip -le 'print UnixDate ParseDate("last

Re: How to figure date of Sunday? Favorite Date/Time packages

2005-06-18 Thread Peter Scott
On Sat, 18 Jun 2005 01:38:44 +0200, Paul Johnson wrote: > Too much work! > > $ perl -MDate::Manip -le 'print UnixDate Date_GetPrev("today", "sun"), "%F"' Or even $ perl -MDate::Manip -le 'print UnixDate ParseDate("last Sunday"), "%F"' -- Peter Scott http://www.perlmedic.com/ http://www.perldeb

Re: How to figure date of Sunday? Favorite Date/Time packages

2005-06-17 Thread John W. Krahn
Siegfried Heintze wrote: Given the current date, I want to compute the date of the Sunday before. There are a lot of date packages on CPAN. Can someone recommend one that would be well suited for this calculation? $ perl -le'print scalar localtime; print scalar localtime time - 86400 * ( local

Re: How to figure date of Sunday? Favorite Date/Time packages

2005-06-17 Thread Paul Johnson
On Fri, Jun 17, 2005 at 04:18:37PM -0700, Wagner, David --- Senior Programmer Analyst --- WGO wrote: > Siegfried Heintze wrote: > > Given the current date, I want to compute the date of the Sunday > > before. There are a lot of date packages on CPAN. Can someone > > recommend one that would be we

RE: How to figure date of Sunday? Favorite Date/Time packages

2005-06-17 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Siegfried Heintze wrote: > Given the current date, I want to compute the date of the Sunday > before. There are a lot of date packages on CPAN. Can someone > recommend one that would be well suited for this calculation? > Siegfried How do you want to handle Sunday? Is that the previous Sun

How to figure date of Sunday? Favorite Date/Time packages

2005-06-17 Thread Siegfried Heintze
Given the current date, I want to compute the date of the Sunday before. There are a lot of date packages on CPAN. Can someone recommend one that would be well suited for this calculation? Siegfried -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <

RE: Translate standard date/time format to EPOCH seconds

2005-05-02 Thread Manav Mathur
|-Original Message- |From: John Doe [mailto:[EMAIL PROTECTED] |Sent: Tuesday, May 03, 2005 1:50 AM |To: beginners@perl.org |Subject: Re: Translate standard date/time format to EPOCH seconds | | |Am Montag, 2. Mai 2005 19.52 schrieb Charles K. Clarkson: |> [EMAIL PROTECTED] <

Re: Translate standard date/time format to EPOCH seconds

2005-05-02 Thread John Doe
Am Montag, 2. Mai 2005 19.52 schrieb Charles K. Clarkson: > [EMAIL PROTECTED] wrote: > : Again, I cannot use a module in this situation due to limitations of > : the runtime environment. > > Well. you could find a module that does what you want. Then lift > out those

RE: Translate standard date/time format to EPOCH seconds

2005-05-02 Thread Charles K. Clarkson
[EMAIL PROTECTED] wrote: : Again, I cannot use a module in this situation due to limitations of : the runtime environment. Well. you could find a module that does what you want. Then lift out those subs and put them in your script. HTH, Charles K. Clarkson -- M

Translate standard date/time format to EPOCH seconds

2005-05-02 Thread jason_normandin
Good morning All. I am looking for a way to translate date/timestamps in various formats to EPOCH seconds without using a module (cannot use a module in this situation other then the standard modules installed with Perl). I am going to create a subroutine and parse the date/timestamp passed int

RE: Why are Date::Time wierd and chart wierd?

2004-12-03 Thread Siegfried Heintze
t, it only works with about 50% of the required modules. Siegfried -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Friday, December 03, 2004 7:09 AM To: 'Siegfried Heintze'; [EMAIL PROTECTED] Subject: RE: Why are Date::Time wierd and chart wierd? Siegfried

RE: Why are Date::Time wierd and chart wierd?

2004-12-03 Thread Bob Showalter
Siegfried Heintze wrote: > Why does not "ppm Date::Time" work? > I also tried > > perl -MCPAN -e 'install "Date::Time"' > > and that does not work either! These are both invalid syntax. Check out http://perl.plover.com/Questions4.html Also, even

Why are Date::Time wierd and chart wierd?

2004-12-02 Thread Siegfried Heintze
Why does not "ppm Date::Time" work? I also tried perl -MCPAN -e 'install "Date::Time"' and that does not work either! I finally went to http://search.cpan.org/~gbarr/ and followed the directions in the readme. This seemed to work! Also, I had problems chart

Re: how to date/time transforming

2004-07-05 Thread Rod Za
Gunnar, --- Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Rod Za wrote: > > How to transform a date in format: > > Thu Jan 18 03:45:50 GMT 1973 > > or > > Qui 01 Jul 2004 21:39:21 BRT > > > > to format: > > > > 1973-01-18 / 2004-06-01 > > Which language is the latter? Brazilian portuguese.

Re: how to date/time transforming

2004-07-05 Thread Gunnar Hjalmarsson
Rod Za wrote: How to transform a date in format: Thu Jan 18 03:45:50 GMT 1973 or Qui 01 Jul 2004 21:39:21 BRT to format: 1973-01-18 / 2004-06-01 Which language is the latter? You can create a hash "%months = ( Jan => '01', ... );", use a regex to extract what you need and format the string using

how to date/time transforming

2004-07-05 Thread Rod Za
How to transform a date in format: Thu Jan 18 03:45:50 GMT 1973 or Qui 01 Jul 2004 21:39:21 BRT to format: 1973-01-18 / 2004-06-01 thank you __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.co

RE: compare date,time

2003-08-27 Thread Kevin Pfeiffer
Hi all, In article <[EMAIL PROTECTED]>, Rob Hanson wrote: > There are lots of ways to do this, but I usually use the Date::Parse > module. It converts a date string into seconds (seconds since 1/1/1970). > > use Date::Parse; > > my $hour = 3600; # 1 hour = 3600 seconds > > my $t1 = str2time("1

compare date,time

2003-08-14 Thread awards
Hi, I have the following 12/08/2003, 11:00 13/08/2003, 23:00 Now I would like to compare them and then calculate the how long time was elapsed in terms of hours. For the example above it will return 36 hours. I don't know if there is a module that do that or a function or we just have to progra

Re: compare date,time

2003-08-14 Thread David Storrs
On Mon, Aug 11, 2003 at 10:25:07PM +0200, awards wrote: > Hi, > > thank you, Now i have a new question. > If I do the code myself which I can do. > would the process of executing the program faster if I do the code myself or > if I use a Module i.e Date::Calc?? > > regards > awards There is a s

Re: compare date,time

2003-08-14 Thread David Storrs
On Wed, Aug 13, 2003 at 09:35:20PM -0700, R. Joseph Newton wrote: > David Storrs wrote: > > > On Mon, Aug 11, 2003 at 10:25:07PM +0200, awards wrote: [snip] > > > would the process of executing the program faster if I do the code myself or > > > if I use a Module i.e Date::Calc?? > > [snip answer

RE: compare date,time

2003-08-14 Thread Hanson, Rob
11, 2003 2:24 PM To: [EMAIL PROTECTED] Subject: compare date,time Hi, I have the following 12/08/2003, 11:00 13/08/2003, 23:00 Now I would like to compare them and then calculate the how long time was elapsed in terms of hours. For the example above it will return 36 hours. I don't know

Re: compare date,time

2003-08-14 Thread R. Joseph Newton
David Storrs wrote: > On Mon, Aug 11, 2003 at 10:25:07PM +0200, awards wrote: > > Hi, > > > > thank you, Now i have a new question. > > If I do the code myself which I can do. > > would the process of executing the program faster if I do the code myself or > > if I use a Module i.e Date::Calc?? >

RE: compare date,time

2003-08-14 Thread Dan Muey
> Hi, Howdy > > I have the following > > 12/08/2003, 11:00 > > 13/08/2003, 23:00 > Now I would like to compare them and then calculate the how > long time was elapsed in terms of hours. For the example > above it will return 36 hours. > > I don't know if there is a module that do that or a

RE: compare date,time

2003-08-14 Thread Stephen Gilbert
> -Original Message- > From: awards [mailto:[EMAIL PROTECTED] > Sent: Monday, August 11, 2003 2:24 PM > To: [EMAIL PROTECTED] > Subject: compare date,time > > > Hi, > > I have the following > > 12/08/2003, 11:00 > > 13/08/2003, 23:00 &

Re: compare date,time

2003-08-11 Thread awards
Hi, thank you, Now i have a new question. If I do the code myself which I can do. would the process of executing the program faster if I do the code myself or if I use a Module i.e Date::Calc?? regards awards -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

RE: return date/time in required format

2003-01-06 Thread Bob Showalter
John Dunn wrote: > I need to return the current date and time in the following format > > MMDDHHMMSS > > but am struggling to do this using the localtime function Use the POSIX strftime() function: use POSIX 'strftime'; print strftime("%Y%m%d%H%M%S", localtime); This works on both

Re: return date/time in required format

2003-01-06 Thread John W. Krahn
"John W. Krahn" wrote: > > John Dunn wrote: > > > > I need to return the current date and time in the following format > > > > MMDDHHMMSS > > > > but am struggling to do this using the localtime function > > > > In perticular, how do I get the month number(e.g. 09 for Sep)? > > my ( $year, $m

Re: return date/time in required format

2003-01-06 Thread John W. Krahn
John Dunn wrote: > > I need to return the current date and time in the following format > > MMDDHHMMSS > > but am struggling to do this using the localtime function > > In perticular, how do I get the month number(e.g. 09 for Sep)? my ( $year, $mon, @time ) = reverse (localtime)[0..5]; my

RE: return date/time in required format

2003-01-06 Thread wiggins
Probably not the prettiest, but it should work... my ($sec,$min,$hour,$mday,$mon,$year) = (localtime(time))[0..5]; my $date = sprintf("%04d",$year+1900) . sprintf("%02d",$mon+1) . sprintf("%02d",$mday) . sprintf("%02d",$hour) . sprintf("%02d",$min) .

RE: return date/time in required format

2003-01-06 Thread Timothy Johnson
is a strftime() function that is similar to 'date' for UNIX, but I haven't used it. -Original Message- From: Dan Muey To: John Dunn; [EMAIL PROTECTED] Sent: 1/6/03 7:10 AM Subject: RE: return date/time in required format Print `date +%m`; Prints '01' for january,

RE: return date/time in required format

2003-01-06 Thread Dan Muey
Print `date +%m`; Prints '01' for january, '02' for February etc You can format all kinds of time with this. Unix> man date Dan -Original Message- From: John Dunn [mailto:[EMAIL PROTECTED]] Sent: Monday, January 06, 2003 8:58 AM To: [EMAIL PROTECTED] Subje

return date/time in required format

2003-01-06 Thread John Dunn
I need to return the current date and time in the following format MMDDHHMMSS but am struggling to do this using the localtime function In perticular, how do I get the month number(e.g. 09 for Sep)? John Dunn Sefas Innovation Ltd 0117 9154267 www.sefas.com -- To unsubscribe, e-mail: [EMA

RE: Formatting date, time

2002-08-13 Thread Bob Showalter
> -Original Message- > From: Bob Showalter [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 13, 2002 9:33 AM > To: 'Gregg O'Donnell'; [EMAIL PROTECTED] > Subject: RE: Formatting date, time > > ... > or, 2) Use the POSIX module's strftime(), w

RE: Formatting date, time

2002-08-13 Thread Bob Showalter
> -Original Message- > From: Gregg O'Donnell [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 13, 2002 9:14 AM > To: [EMAIL PROTECTED] > Subject: Formatting date, time > > I'm looking for the simplest way to use the date and time in > the format o

Re: Formatting date, time

2002-08-13 Thread Robin Norwood
"Gregg O'Donnell" <[EMAIL PROTECTED]> writes: > > > I'm looking for the simplest way to use the date and time in the format of >MMDDYYHHmm (no spaces), which is used later in the program. > > Here's what I've come up with; comments or suggestions are appreciated. > > #Insert Date and Time >

Re: Formatting date, time

2002-08-13 Thread Tor Hildrum
<[EMAIL PROTECTED]> wrote: > #Insert Date and Time > my $month = $mon00 #Two digit month > my $day = $mday00 #Two digit day in month > my $year = $year#Two digit year ?? > my $hour = $hour00 #Two digit: Hour > my $min = $min00 #Two digit: Minutes > #Combine date and time above into MMD

Formatting date, time

2002-08-13 Thread Gregg O'Donnell
I'm looking for the simplest way to use the date and time in the format of MMDDYYHHmm (no spaces), which is used later in the program. Here's what I've come up with; comments or suggestions are appreciated. #Insert Date and Time my $month = $mon00 #Two digit month my $day = $mday00 #Two

Re: Best module to use for Date/Time calculations?

2002-04-19 Thread Peter Scott
At 10:59 AM 4/19/02 -0400, KEVIN ZEMBOWER wrote: >What module would folks recommend to do some math on Date/Time strings? >There's so many to choose from in CPAN, I'm not sure where to start. > >I'm interested in processing a web server log, which has a data forma

Best module to use for Date/Time calculations?

2002-04-19 Thread KEVIN ZEMBOWER
What module would folks recommend to do some math on Date/Time strings? There's so many to choose from in CPAN, I'm not sure where to start. I'm interested in processing a web server log, which has a data format like: gw243.carlson.com - - [01/Feb/2002:17:18:54 -0500] "GET

Re: File date/time stamp

2001-12-13 Thread Jon Molin
stat is what you want, 'man perlfunc'. ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = stat($filename); /Jon Michael Pratt wrote: > > Hello, > > How do I get a file date time sta

File date/time stamp

2001-12-13 Thread Michael Pratt
Hello, How do I get a file date time stamp? Thanks Mike _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: date/time

2001-10-01 Thread Ricardo Derbes
uot;Beginners (E-mail)" <[EMAIL PROTECTED]> Sent: Monday, October 01, 2001 12:44 PM Subject: date/time > Folks, > > Looking for a little help for taking current time (from time) and finding > the time until 1 minute after midnight. > > I have a daemon process (perl scr

Re: date/time

2001-10-01 Thread Daniel Gardner
YR> Looking for a little help for taking current time (from time) and finding YR> the time until 1 minute after midnight. YR> I have a daemon process (perl script) that needs to die ever new day, YR> the process should only run from 12:01 AM Today - l 12:01 AM Tomorrow as ever there's more tha

Re: date/time

2001-10-01 Thread eplowe
That sounds like a job for a crontab there, Ronald. ~Eric - Original Message - From: "Yacketta, Ronald" <[EMAIL PROTECTED]> To: "Beginners (E-mail)" <[EMAIL PROTECTED]> Sent: Monday, October 01, 2001 11:44 AM Subject: date/time > Folks, > > Loo

RE: date/time

2001-10-01 Thread Brett W. McCoy
On Mon, 1 Oct 2001, John Edwards wrote: > How about getting the program to write a little text file out containing the > time it was last started. Check this date from within the script and if the > date is yesterday and the time is > 12:01am then restart. > > How often does the script finish it'

  1   2   >