Re: Date to seconds

2003-09-17 Thread Rob Dixon
Kit-Wing Li wrote: > > Does anybody know of a quick method in perl to turn a date string into its > equivalent in seconds, include milliseconds if possible? Ex: 20030910 > 13:50:25.6 to 1063202644. Thanks much! The Date::Manip module will do it for you easily, as long as you're not worried abou

Re: Date to seconds

2003-09-11 Thread Alexander Blüm
Li, Kit-Wing wrote: Hi, Does anybody know of a quick method in perl to turn a date string into its equivalent in seconds, include milliseconds if possible? > Ex: 20030910 13:50:25.6 to 1063202644. Thanks much! starting when? I mean, you 1063202644 seconds, and these are 33years : 37weeks : 01d

Re: Date

2003-06-17 Thread Casey West
It was Tuesday, June 17, 2003 when Van Andel, Robbert took the soap box, saying: : How do I retrieve the system's current hour and date and assign them to a : variable? Perl's builtin function called 'localtime' can help you here. It returns a list of information about the current time and date,

Re: Date Range

2003-01-29 Thread Wiggins d'Anconia
Melissa Stranzl wrote: Hi all, This is part of a perl program I wrote that doesn't compile. I am trying to get my database to search by date- to have current and past events come up. Anyway, based on the following code, I get an error message that reads: can't locate object method "new" via pa

Re: Date Range

2003-01-29 Thread Bob Showalter
Melissa Stranzl wrote: > Hi all, > > This is part of a perl program I wrote that doesn't > compile. I am trying to get my database to search by > date- to have current and past events come up. > Anyway, based on the following code, I get an error > message that reads: > > can't locate object metho

Re: Date

2003-01-21 Thread david
Mad Hatter wrote: > I am writing a cgi script to run as a cron job. when > it runs i need the date of 'one year ago today' in the > format '-MM-DD' to be stored in a variable to be > used later in the script. I am about as dumb as wet > dirt when it comes to cgi. Can someone please help me

Re: Date

2003-01-21 Thread Octavian Rasnita
Hi, my ($sec, $min, $hour, $mday, $mon, $year) = localtime(time()); $year += 1900; $year -= 1; #if you want the last year my @months = qw(01 02 03 04 05 06 07 08 09 10 11 12); my $time = "$year-$months[$mon]-$mday"; Note: I don't know if Perl will put 01, 02, 03, ... for the first days. Perhaps i

Re: Date

2003-01-21 Thread WilliamGunther
In a message dated 1/21/2003 12:15:36 AM Eastern Standard Time, [EMAIL PROTECTED] writes: > I am writing a cgi script to run as a cron job. when > it runs i need the date of 'one year ago today' in the > format '-MM-DD' to be stored in a variable to be > used later in the script. I am abou

Re: Date Question(s)

2002-09-18 Thread Wiggins d'Anconia
Date::Calc is a wonderful thing. If that doesn't work however I would suggest just storing the number of seconds from epoch (aka time) in the log file. Then you simply subtract 30 days worth of seconds aka, 60*60*24*30 seconds -> which you can just use the constant for whatever that comes out

Re: Date Question(s)

2002-09-18 Thread William McKee
I'd suggest checking out Date::Manip from CPAN. I use it to do date comparisons in some of my scripts. Why do you need to convert the date when writing it to the file. Just save the epoch time and use Date::Manip to eval the epoch time in the file to the current epoch time. William -- Lead

Re: Date Question(s)

2002-09-18 Thread fliptop
On Wed, 18 Sep 2002 at 12:53, [EMAIL PROTECTED] opined: [snip] n:My problem with this scenario involves my lack of knowledge in -- n: n:A. ... first converting a current system date to a string date (which can n:be appended to a text log file). n:B. ... or comparing the logged initial-question d

Re: Date format again

2002-03-03 Thread fliptop
Troy May wrote: > Hello, this guy finally emailed his script to me. The problem he is having > is with "$year". Here's the dating part of the code: > > --- > $date = `/bin/date`; > chop($date); has this guy considered using Date::Calc? http://search.cpan.

RE: Date Functions

2002-02-01 Thread Bob Showalter
> -Original Message- > From: David Gilden [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 31, 2002 5:28 PM > To: [EMAIL PROTECTED] > Subject: Date Functions > > > Hi, > > I am updating an old Script. > > Are there any problems or 'Y2k' bugs, > in the following change? No. Looks

RE: Date

2001-07-26 Thread WPhillips
Fred, I don't know if this will help, but I have this code that figures out what yesterday's date is. It should be relatively simple to change it to two days ago. I am sure that there are easier ways to do it, but this has been working for me for a long time. The only two caveats are that I didn

RE: Date

2001-07-25 Thread Bradley M. Handy
Also, take a local a the Date::Calc module for the date arithmetic. Brad Handy --www.jack-of-all-trades.net [EMAIL PROTECTED] > -Original Message- > From: Venkat Mohan [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 25, 2001 12:58 PM > To: 'Fred Sahakian';

RE: Date

2001-07-25 Thread Venkat Mohan
You can use Time::Local package. There is a function timelocal takes the seconds, minutes, hours, day, month, year and returns epoch seconds. - Venkat -Original Message- From: Fred Sahakian [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 9:53 AM To: < Subject: Date Im Stuck!