Click here to Skip to main content
15,895,799 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: give me some advise for my linxu road! Pin
wbgxx10-Apr-10 20:27
wbgxx10-Apr-10 20:27 
AnswerRe: give me some advise for my linxu road! Pin
ChinaLoong20-Mar-10 1:54
ChinaLoong20-Mar-10 1:54 
QuestionSEO and php site Pin
sharkbc28-Jan-10 16:55
sharkbc28-Jan-10 16:55 
AnswerRe: SEO and php site Pin
vorotnik8-Feb-10 4:07
vorotnik8-Feb-10 4:07 
AnswerRe: SEO and php site Pin
abushahin8-Feb-10 9:14
abushahin8-Feb-10 9:14 
QuestionTimestamps... Can't Seem to get it to work..... Pin
thebiostyle27-Jan-10 14:23
thebiostyle27-Jan-10 14:23 
AnswerRe: Timestamps... Can't Seem to get it to work..... Pin
Graham Breach27-Jan-10 23:02
Graham Breach27-Jan-10 23:02 
AnswerRe: Timestamps... Can't Seem to get it to work..... Pin
fly90428-Jan-10 1:07
fly90428-Jan-10 1:07 
QuestionPerl "days in the future" Pin
m. holliday20-Jan-10 9:32
m. holliday20-Jan-10 9:32 
AnswerRe: Perl "days in the future" Pin
Graham Breach20-Jan-10 10:11
Graham Breach20-Jan-10 10:11 
QuestionReiserFS disc accessing Pin
Aljaz11115-Jan-10 12:31
Aljaz11115-Jan-10 12:31 
AnswerRe: ReiserFS disc accessing Pin
Jimmanuel18-Jan-10 3:13
Jimmanuel18-Jan-10 3:13 
Questiondate difference script Pin
Jay Tee13-Jan-10 18:46
Jay Tee13-Jan-10 18:46 
AnswerRe: date difference script Pin
Rob15-Jan-10 4:16
Rob15-Jan-10 4:16 
AnswerRe: date difference script Pin
Sethsdad15-Jan-10 7:51
Sethsdad15-Jan-10 7:51 
GeneralRe: date difference script Pin
Justin20-Jan-10 21:24
Justin20-Jan-10 21:24 
Thanks that works great.

Here is what i came up with.

#!/usr/bin/perl
use Date::Calc qw(Delta_Days);
use Time::Piece;
($sec, $min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
open (MYDATA, "data.txt") or die ("Error: cannot open file 'ARGV[0]'\n");
my @lines1 = <MYDATA>;
# chomp @lines1;
my $t = Time::Piece->strptime("@lines1",
"%b %d,%Y");
$year1 = $year + 1900;
$mon1 = $mon + 1;
$mday1 = $mday;
$year2 = ( $t->strftime("%Y"));
$mon2 = ( $t->strftime("%m"));
$mday2 = ( $t->strftime("%d"));
$difference = Delta_Days($year1, $mon1, $mday , $year2, $mon2, $mday2);
print "There were $difference days between Nat and Bree\n";
print "email user\n" if $difference <= 15;

data.txt
Jan 24, 2010
QuestionI need an ebay program Pin
totolcm13-Jan-10 2:22
totolcm13-Jan-10 2:22 
Questionimap_search problem Pin
nathionice11-Jan-10 22:46
nathionice11-Jan-10 22:46 
AnswerRe: imap_search problem Pin
Niall Barr12-Jan-10 3:08
professionalNiall Barr12-Jan-10 3:08 
GeneralRe: imap_search problem Pin
nathionice12-Jan-10 4:05
nathionice12-Jan-10 4:05 
GeneralRe: imap_search problem Pin
Niall Barr12-Jan-10 4:44
professionalNiall Barr12-Jan-10 4:44 
GeneralRe: imap_search problem Pin
nathionice12-Jan-10 6:20
nathionice12-Jan-10 6:20 
GeneralRe: imap_search problem Pin
Niall Barr12-Jan-10 22:38
professionalNiall Barr12-Jan-10 22:38 
AnswerRe: imap_search problem Pin
elizas19-Jan-10 0:53
elizas19-Jan-10 0:53 
GeneralReply: Pin
sarahcolin119-Jan-10 19:57
sarahcolin119-Jan-10 19:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.