LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Get day of the year for a specific date (https://www.linuxquestions.org/questions/linux-general-1/get-day-of-the-year-for-a-specific-date-4175488420/)

SmurfGGM 12-18-2013 05:41 AM

Get day of the year for a specific date
 
Hi there

I would like to the day number of the year for a specific date.

Process_date=`date +%d/%m/%Y`

Then get the day of the year from $Process_date.

The process date will not always be today's date.

Thanks in advance.

sycamorex 12-18-2013 05:47 AM

See if that helps:
http://www.unix.com/shell-programmin...ll-script.html

SmurfGGM 12-18-2013 05:54 AM

Cool :)

Srted by ..

Process_date=`date +%Y%m%d`
date -d $Process_date +%j
352

Cheers

Habitual 12-18-2013 06:21 PM

Quote:

Originally Posted by SmurfGGM (Post 5083175)
Code:

Process_date=`date +%Y%m%d`
date -d $Process_date +%j

352

Clever. ;)


All times are GMT -5. The time now is 09:46 AM.