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
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
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,
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
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
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
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
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
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
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
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
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.
> -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
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
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';
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!
16 matches
Mail list logo