LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 10-15-2007, 10:08 PM   #1
monu
LQ Newbie
 
Registered: Jun 2007
Posts: 17

Rep: Reputation: 0
find #of years from date


Hi,

how to figure out age from years? for example.

read -p "welcome to LinuxQuestions.org.. Please enter your date of birth:" 19850409

echo "you are 22 years and 3 months old!"

i use YYYMMDD formate.

I use 'date -d ....' not sure..

I separated year, month and day so no worries about it.Only thing i can't figured it out is person age from date year

Thanks

Last edited by monu; 10-15-2007 at 10:15 PM. Reason: correction
 
Old 10-15-2007, 10:18 PM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu (x86), Debian (PPC)
Posts: 3,528

Rep: Reputation: 60
would this be.... homework?
 
Old 10-15-2007, 10:36 PM   #3
monu
LQ Newbie
 
Registered: Jun 2007
Posts: 17

Original Poster
Rep: Reputation: 0
no.. I just want to practice and fun
 
Old 10-15-2007, 10:40 PM   #4
monu
LQ Newbie
 
Registered: Jun 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Hi,

I figured out year age!! cool..

what i did is current year - given year=age

now I only have to find out month

Last edited by monu; 10-15-2007 at 10:43 PM.
 
Old 10-15-2007, 11:36 PM   #5
monu
LQ Newbie
 
Registered: Jun 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Hi,

I figured it out everything.. sorry for this post

thanks
 
  


Reply

Tags
date


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Way to find install date for a linux system kdrlx Linux - Software 5 02-01-2012 06:00 AM
Two years to find a working Linux distro.... ONEderer Linux - Desktop 2 09-15-2006 11:34 PM
How to find the date for all the files in a directory Uday123 AIX 6 02-23-2006 08:26 PM
Find variable in template file replace w/date+ and save as jmanjohn61 Linux - General 14 12-13-2004 06:49 AM
find installation date Pete Dogg Linux - Software 4 09-27-2003 11:51 AM


All times are GMT -5. The time now is 07:25 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration