HI,
I am able to find days difference using FIND command. However it is comparing between today and the last time it was modified.
I now need to find the difference between a date specified by myself and the last time the file was modified. Is there a command which I can use or I have to... (1 Reply)
hi ,
I have two variables both containg dates,
x= `date`
and
y= `date'
their format being -> Fri Nov 12 22:59:50 MST 2004
how do I compare which one is greater.
->Can dates be converted into integer and then compared?
( one lengthy way would be to compare the words one by... (7 Replies)
Hi All.
Can someone please give me an example of how I'd do a comparison to find out if the last modified date of a file is newer than yesterday (i.e. today - 1 day)?
Example:
if ; then
echo "Do something..."
fi
Any ideas or examples?
Thanks. (1 Reply)
Hi guys
I have a a variable called check_ts which holds a date value. this date value keeps refreshing every 15 minutes.
I am going to start a cron job 5 minutes after the refresh. I have to check if the current date > 20 min of check_ts. how do i do that.
thanks
ragha (17 Replies)
Hi,
I want to compare today's date(DDMMYYYY) with yesterday(DDMMYYYY) from system date,if (today month = yesterday month) then execute alter query else do nothing.One more condition is change of year also i.e today is Jan1 2012 and yesterday is Dec 31 2011.
The above rek i want in Shell... (4 Replies)
Hi
I'm trying to compare the current date (dd-Mmm-yyyy) against a variable that is an extracted date from an sql script. Below is the code:
datenow=`date '+%d-%h-%Y'`
#datenow is the current date in the format dd-Mmm-yyyy
sqlplus $dbuserid/$dbpassword @ $SCRIPT_PATH/business-date.sql >... (3 Replies)
Hi,
can we do date comparisons in unix? like if i give the two dates find which date is old one and which is new one and difference between the two dates in terms of hours,minutes,days and months. (1 Reply)
Hi
I am failing to write a script which compares a list of dates in a file with today's date.
OS: Solaris 10
I have a file which has server names & dates, i need to compare the date in this file with today's date, if it is less than today it should print the server name.
code i tried is ... (3 Replies)
Discussion started by: nanz143
3 Replies
LEARN ABOUT MOJAVE
time::epoch
Epoch(3) User Contributed Perl Documentation Epoch(3)NAME
Time::Epoch - Convert between Perl epoch and other epochs
SYNOPSIS
#!/usr/bin/perl -wl
use Time::Epoch;
my $perlsec = 966770660; # Sun Aug 20 07:24:21 2000 -0400 on Mac OS
my $epochsec = perl2epoch($perlsec, 'macos', '-0400');
my $perlsec2 = epoch2perl($epochsec, 'macos', '-0400');
print $perlsec;
print $perlsec2;
print $epochsec;
# correct time on Unix:
print scalar localtime $perlsec;
# correct time on Mac OS (-0400):
print scalar localtime $epochsec;
DESCRIPTION
Exports two functions, "perl2epoch" and "epoch2perl". Currently only goes between Perl (Unix) epoch and Mac OS epoch. This is in
preparation for an eventual move of Perl to its own universal epoch, so we can get the system epoch of any platform that differs from
Perl's.
Epochs
o macos
Takes additional optional parameter of time zone differential. If time zone differential not supplied, we guess by getting the
different between "localtime" and "gmtime" with <Time::Local::timelocal>.
BUGS
o Hm. With the above test, "scalar localtime $perlsec" under my Linux box and "scalar localtime $epochsec" under my Mac OS box are off
by one second from each other. Maybe a leap second thing? Odd.
AUTHOR
Chris Nandor <pudge@pobox.com>, http://pudge.net/
Copyright (c) 2000-2003 Chris Nandor. All rights reserved. This program is free software; you can redistribute it and/or modify it under
the terms of the Artistic License, distributed with Perl.
SEE ALSO perl(1), perlport(1), Time::Local.
perl v5.18.2 2003-05-21 Epoch(3)