[SOLVED] how to extract the day and month from a user supplied date ?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers [SOLVED] how to extract the day and month from a user supplied date ?
# 8  
Old 09-19-2012
My bad, sorry about that, glad you figured out my error!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to get first & last day of a month from current date?

Hi, I need the first & last day of a month from any given date. For better understanding, if i need to back-fill data for date 07/20/2019 i.e July 20 2019, i need the first & last day has 07/01/2019 - 07/31/2019. FYI: I'm using GIT BASH terminal. sample code: export DT=$(date --date='6 days... (2 Replies)
Discussion started by: Rocky975583
2 Replies

2. UNIX for Dummies Questions & Answers

[Solved] Using date command, getting previous day

Legends, i need to get previous day using date command. Can you please help. sdosanjh:/home> date +%m%d%y 011514 i tried -d '-1 day' but it is not working (5 Replies)
Discussion started by: sdosanjh
5 Replies

3. AIX

Need to get the next day's date of the user entered date

I need to get the next day's date of the user entered date for example: Enter date (yyyy/mm/yy): 2013/10/08I need to get the next day's date of the user entered date Desired Output: 2013/10/09Though there are ways to achieve this is Linux or Unix environment (date command) ,I need to... (1 Reply)
Discussion started by: rpm120
1 Replies

4. Shell Programming and Scripting

Script to counting a specific word in a logfile on each day of this month, last month etc

Hello All, I am trying to come up with a shell script to count a specific word in a logfile on each day of this month, last month and the month before. I need to produce this report and email it to customer. Any ideas would be appreciated! (5 Replies)
Discussion started by: pnara2
5 Replies

5. Shell Programming and Scripting

How to extract log data based on current date and month ?

Hi Gurus, I'm using HP-UX B.11.23 operating system. I've been trying to extract this log info based on the current date and month, but was having some issues as the date column which on the 4th column has a comma and the 5th column has a dot tied to it. Here is the output from my shut... (5 Replies)
Discussion started by: superHonda123
5 Replies

6. Shell Programming and Scripting

Get yesterday's date in year-month-day format?

Dear All, Actually, i'm doing some reporting job and i need to pass yesterday's date in Year-Month-Day format(e.g. 2009-06-10) to another program for generating 2009-06-10 report. to get today's date, it's easy to just date '+%Y%m%d' , but no idea how can i get this kind of format for... (2 Replies)
Discussion started by: tiger2000
2 Replies

7. Shell Programming and Scripting

needs to display month for previous day date

Hello, I wanted to display the month for previous day date. Like, today date is 18-Nov-2008. So the previous date is 17-Nov-2008. The output should be November. If the today date is 1-DEC-2008, then output should be NOVEMBER. If the today date is 1-JAN-2008, then output should be DECEMBER.... (4 Replies)
Discussion started by: govindts
4 Replies

8. Shell Programming and Scripting

single digit for day and month on date

hi all, how do i format the date command so it displays day and month in single digits i.e 8 instead of 08 ?? am using the command (in a ksh) : date +%D output i get is 10/08/08 thanks in advance. (5 Replies)
Discussion started by: cesarNZ
5 Replies

9. Shell Programming and Scripting

Cron to run first day of month to calculate date 3 months ago

Hi, I would like to find out how can i calculate a date which is 3 months ago. I intend to run a cron job on the 1st of every month, and calculate the month 4 months earlier from the date. For example, if today's date is 1st May 2007, i would like to return 012007( January 2007). i can get... (1 Reply)
Discussion started by: new2ss
1 Replies

10. Shell Programming and Scripting

Write a shell script to find whether the first day of the month is a working day

Hi , I am relatively new to unix... Can u pls help me out to find out if the first day of the month is a working day ie from (Monday to Friday)...using Date and If clause in Korn shell.. This is very urgent. Thanks for ur help... (7 Replies)
Discussion started by: phani
7 Replies
Login or Register to Ask a Question
CAL(1)								   User Commands							    CAL(1)

NAME
cal - display a calendar SYNOPSIS
cal [options] [[[day] month] year] DESCRIPTION
cal displays a simple calendar. If no arguments are specified, the current month is displayed. OPTIONS
-1, --one Display single month output. (This is the default.) -3, --three Display prev/current/next month output. -s, --sunday Display Sunday as the first day of the week. -m, --monday Display Monday as the first day of the week. -j, --julian Display Julian dates (days one-based, numbered from January 1). -y, --year Display a calendar for the current year. -V, --version Display version information and exit. -h, --help Display help screen and exit. PARAMETERS
A single parameter specifies the year (1 - 9999) to be displayed; note the year must be fully specified: cal 89 will not display a calendar for 1989. Two parameters denote the month (1 - 12) and year. Three parameters denote the day (1-31), month and year, and the day will be highlighted if the calendar is displayed on a terminal. If no parameters are specified, the current month's calendar is displayed. A year starts on Jan 1. The first day of the week is determined by the locale. The Gregorian Reformation is assumed to have occurred in 1752 on the 3rd of September. By this time, most countries had recognized the ref- ormation (although a few did not recognize it until the early 1900's). Ten days following that date were eliminated by the reformation, so the calendar for that month is a bit unusual. HISTORY
A cal command appeared in Version 6 AT&T UNIX. AVAILABILITY
The cal command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/. util-linux June 2011 CAL(1)