Sponsored Content
Full Discussion: days elapsed between 2 dates
Top Forums UNIX for Dummies Questions & Answers days elapsed between 2 dates Post 16449 by rkkiran on Friday 1st of March 2002 01:47:02 PM
Old 03-01-2002
days elapsed between 2 dates

does anybody know how to find out the number of
days elapsed between 2 dates

e.g.

days elapsed between 020212 and 020110 (YYMMDD format)

Thanking you in advance.

Ravi.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Difference between two dates in no of days ???

Hi All How to get the difference between two dates in no of days ??? My date format is like this YYYY/MM/DD. I have to get the no of days between two dates in the given format. I tried to search the forum but nothing came up similar to my requitement. Your help will be appreciated. ... (1 Reply)
Discussion started by: csaha
1 Replies

2. UNIX for Advanced & Expert Users

Number of days between two distinct dates

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

3. Shell Programming and Scripting

Days difference between two dates

Hello, I would like to find out the number of days between two dates of the format yyyy-mm-dd. Any help on this is highly appreciated. Thanks. (6 Replies)
Discussion started by: Data469
6 Replies

4. UNIX for Dummies Questions & Answers

using 'date' to get previous days' dates

I am familiar with using the 'date' command to get the current date but I have a situation where I need to get the previous day's date as well as the date two days prior. Theoretically I could use 'expr' to compute these values but I need it to work in instances where the previous month's dates... (2 Replies)
Discussion started by: slant-40
2 Replies

5. Shell Programming and Scripting

display all dates 200 days back

i need help! can someone help me please? i try to calculate date under unix (ksh)...AIX operating system. I have to find the date 200 days from today's date. then the script should loop 200 times and display on command line every day's date until the current date. example: todays date:... (4 Replies)
Discussion started by: pavan_test
4 Replies

6. Shell Programming and Scripting

Get number of days between given dates

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

7. Shell Programming and Scripting

days are between the two dates?

I have two times in the format of YYMMDD. Does anyone know an easy way in ksh for me to display how many days are between the two dates? Example1: X=101202 Y=101205 There are 3 days between X & Y Example2: X=101202 Y=111202 There are 365 days between X & Y Example3: X=101205... (3 Replies)
Discussion started by: oldman2
3 Replies

8. Shell Programming and Scripting

Calculate days between yyyyMmmdd dates on Solaris

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

9. UNIX for Advanced & Expert Users

How to get the sunday days between two dates?

Hi Am using Unix Ksh I have a two date input as DATE1=02/12/2012 DATE2=30/12/2012 I Need the output as only sunday date 02/12/2012 09/12/2012 16/12/2012 23/12/2012 30/12/2012 can anyone pls help me.. thanks in advance... (2 Replies)
Discussion started by: Venkatesh1
2 Replies

10. Shell Programming and Scripting

Get number of days between 2 dates

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
birthday(1)						      General Commands Manual						       birthday(1)

NAME
birthday - warn about upcoming birthdays and other events SYNOPSIS
birthday [-w|-c] [-f file] [-W defwarn] [-M maxwarn] [-m minwarn] [-l lines] [-p weeks] [-d total] [-i width] DESCRIPTION
The birthday command reads a file, by default ~/.birthdays, which gives a list of events in the near future (see section FILE FORMAT for details). It can then produce either a list of events which are coming up within the next few weeks, or a text-based calendar with a few lines for each day. OPTIONS
-w Display a list of upcoming events. This is the default. -c Display a calendar, designed to be piped to lpr(1). -f file Read the events from file rather than ~/.birthdays. If file is a single hyphen, read the events from the standard input (usually the terminal). List Options -W warn Warn warn days in advance, for entries that have no w flag (see FILE FORMAT). If this switch is not specified, it defaults to 21 days. -M max Warn at most max days in advance. This overrides any flag given in the file. -m min Warn at least min days in advance. This overrides any flag given in the file. Calendar Options -l lines Print lines lines for every day. -p weeks Print weeks weeks on every page of the calendar. If set to 0, the default, disables page breaks. -d days Print the calendar for up to days days in advance. -i width Print the calendar width characters wide. This affects the length of the lines separating each day, and the point at which events will be word-wrapped. FILE FORMAT
Each line beginning with a hash sign, `#', is a comment and will be ignored. Lines beginning with an ampersand, `&', are directives. Cur- rently there is only one such directive, &include file, which reads in a seperate file from your .birthdays file. file should be given with an absolute path, which should not use the tilde notation to specify your home directory. Any other line specifies the name of a person or event, followed by an equals sign and a date (DD/MM, DD/MM/YY or DD/MM/YYYY, where the form DD/MM/YY is assumed to give a date in the 20th century and is now deprecated), and finally some extra options. These options are: bd This line is a birthday (the default). The year, if given, should be when the person was born. A line designated as a birthday will produce output like Erin has a birthday in 3 days' time or Jemima is 3 in 2 weeks' time. ann This line is an anniversary. The year, if given, should be the year in which the thing happened, producing output like Pen exploded 3 years ago tomorrow given a line such as Pen exploded=12/09/93 ann. ev This line is an event of some sort. If a year is given, the text will be displayed in that year only; otherwise, it will be dis- played every year. The remaining time is simply appended to the text; for instance, the input Easter=7/4/1996 ev would give rise to the text Easter in 1 week's time. wn Warn n days in advance of the date, rather than the default of 21 days or the number given with the -W flag. todate The event lasts until date, which should be in the same format as for the date of the event. fordays The event lasts for days days. DATE SPECIFICATION
The file format documented here handles dates in a couple of slightly non-standard ways. Firstly, the dates are given in British format of DD/MM/YYYY, as opposed to the more normal US format MM/DD/YYYY. Secondly, dates with a two-digit year are assumed to be in the 20th century (19xx), rather than taking the standard convention of assuming all two-digit years less than 70 are in the 21st century. This is for reasons of compatibility with older data files, since many people have birthdays before 1970, and the program was written before I came across the Y2K issues. :-( You should probably avoid this format. EXAMPLE
Joe Blow=25/04/1974 FILES
~/.birthdays Your default birthdays file. SEE ALSO
cal(1) BUGS
Both the "features" in the DATE SPECIFICATION section could be construed as bugs, and are mostly present for backwards compatibility. The calendar mode should be a seperate program. The program cannot warn more than one year in advance of anything. AUTHOR
Andy Mortimer <andy.mortimer@zetnet.co.uk> birthday(1)
All times are GMT -4. The time now is 11:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy