10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Gents.
Please can u help.
I would like to calculate the days between two dates.
Example file1 ( previous date)
file1 - Input file
9/29/2010 10195
9/29/2010 1057
2/2/2016 10
2/2/2016 10169
2/2/2016 1057
2/3/2016 10005
2/3/2016 10014
In file2 I add the actual date using this code.... (9 Replies)
Discussion started by: jiam912
9 Replies
2. Shell Programming and Scripting
shell script to calculate difference between 2 dates (3 Replies)
Discussion started by: gredpurushottam
3 Replies
3. Web Development
Is this code good for this purpose?
<?php
$date1 = mktime(0,0,0,01,01,1991);
$date2 = mktime(0,0,0,03,22,2012);
$diff = $date2 - $date1;
$days = $diff / (60*60*24);
echo ($days . "<br />");
?> (3 Replies)
Discussion started by: kovacsakos
3 Replies
4. Shell Programming and Scripting
I extract dates from the log file and need to calculate days between two dates. My dates are in yyyyMmmdd format. Example:
$d1=2011 Oct 21
$d2=2012 Feb 20
I need to calculate the number of days between $d2 and $d1. This is on Solaris.
Any ideas?
Thanks,
djanu (4 Replies)
Discussion started by: djanu
4 Replies
5. Shell Programming and Scripting
Hi
I need one single command to get number of days between
two given dates.datecalc is not working.
ex.
fromdate:01.04.2010
todate :24.04.2010
i should get the out put as 23
Thanks in advance (4 Replies)
Discussion started by: suryanarayana
4 Replies
6. Shell Programming and Scripting
Hi Guys,
I was working some time ago n was in need to calculate date 30/31 days from today including Feb (Leap yr stuff). Today date is variable depending on day of execution of script. I tried searching but was not able to get exactly what I needed....So at that I time I implemented by my own... (3 Replies)
Discussion started by: coolgoose85
3 Replies
7. Shell Programming and Scripting
I need a script to figure out if a user's last login was 90 days or older. OS=AIX 5.3, shell=Korn
Here's what I have so far:
====
#!/usr/bin/ksh
NOW=`lsuser -a time_last_login root | awk -F= '{ print $2 }'`
(( LAST_LOGIN_TIME = 0 ))
(( DIFF = $NOW - $LAST_LOGIN_TIME ))
lsuser -a... (3 Replies)
Discussion started by: pdtak
3 Replies
8. Shell Programming and Scripting
does any one have any ideas how i would go about calculating the number of days left in the month from a bash script ?. I want to do some operations on a csv file according to the result (8 Replies)
Discussion started by: dunryc
8 Replies
9. UNIX for Advanced & Expert Users
Hi
I'm looking for a .ksh script/function that will calculate ONLY the number of days between two distinct dates. Further convert the number of days to weeks and display. I need this to be part of another larger script that checks the password expiry on several servers and notifies the... (1 Reply)
Discussion started by: radheymohan
1 Replies
10. Shell Programming and Scripting
Hi All,
Can unix cshell list out the number of days between 070201 and 070205 (format is yymmdd) and list out all the dates in between in similiar format.
set startdate = `date '+%y%m%d'` #eg 070201
set enddate = `date '+%y%m%d'` #eg 070205
i would expect the number of days to be 5... (2 Replies)
Discussion started by: Raynon
2 Replies