Sponsored Content
Top Forums Shell Programming and Scripting Use date command to find last month Post 302131385 by jim mcnamara on Friday 10th of August 2007 09:53:47 AM
Old 08-10-2007
This will not work for a variety of reasons.
What happens on March 31 - You'll go back to February 31?
What happens on Jan 10?

Check the FAQ for perderabo's datecalc script. It will do just what you want.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find out month from a date

I would like to find out the month from a given date, how is it possible. (5 Replies)
Discussion started by: rudoraj
5 Replies

2. Shell Programming and Scripting

How to find the create time of a file if current date is in next month

Hi All, I want to find the time diffrence between currnt time and "abc.txt" file create time. I have solve that but if the abc.txt file created last month then is there any process to find the difftent? Exp: Create time of abc.txt is "Apr 14 06:48" and currect date is "May 17 23:47".... (1 Reply)
Discussion started by: priyankak
1 Replies

3. UNIX for Dummies Questions & Answers

Date command to obtain the last month is not working correctly..

Hello, I could not find the exactly same post here.. so I will explain what I did to get the last month using date command. I used date +%Y-%m -d "-1 months" to get the last month. However, the returned value of above command on 2009/10/31 was 2009 10 and not 2009 09.. and the... (9 Replies)
Discussion started by: tigersk
9 Replies

4. UNIX for Dummies Questions & Answers

print previous month (current month minus 1) with Solaris date and ksh

Hi folks month=`date +%m`gives current month Howto print previous month (current month minus 1) with Solaris date and ksh (7 Replies)
Discussion started by: slashdotweenie
7 Replies

5. UNIX for Dummies Questions & Answers

date command - getting previous month

Hi, On any given day, I want to capture the month that has gone by - said otherwise, how do I capture last month? expr date '+%m' - 1 Above expression is giving error. Please advise thanks ---------- Post updated at 09:28 AM ---------- Previous update was at 09:11 AM... (1 Reply)
Discussion started by: ab_2010
1 Replies

6. UNIX for Dummies Questions & Answers

Unix man command to find out month of the year?

how can i display month of the year i was born with using man command? thanks (2 Replies)
Discussion started by: janetroop95
2 Replies

7. Shell Programming and Scripting

Help with getting last date of previous month and first date of previous 4th month from current date

I have requirment to get last date of previous month and the first date of previous 4th month: Example: Current date: 20130320 (yyyymmdd) Last date of previous month: 20130228 (yyyymmdd) First date of previous 4th month: 20121101 (yyyymmdd) In my shell --date, -d, -v switches are not... (3 Replies)
Discussion started by: machomaddy
3 Replies

8. Red Hat

How to find/display out last Friday's date of the month?

Hello, Can you please help me find/display out last Friday's date of the month using command in Unix/Linux (3 Replies)
Discussion started by: sunnysthakur
3 Replies

9. Shell Programming and Scripting

How to find all files other than first two dates & last date per month and year?

how to find all files other than first two dates & last date per month and year Hi All, lets say there are following files in directory -rwxr-xr-x 1 user userg 1596 Mar 19 2012 a.txt -rwxr-xr-x 1 user userg 1596 Mar 19 2012 b.txt -rwxr-xr-x 1 user userg ... (6 Replies)
Discussion started by: Makarand Dodmis
6 Replies

10. Shell Programming and Scripting

Find one month before date

Hi, I want two dates one will be the current date and the other one will be just one month before. Say if current month is 11/4/2014 then the other date should be 11/3/2014. #!/bin/ksh currentDtae=`date` oneMonthBefore= ? I dont know how to do it. Went through some of the related threads... (15 Replies)
Discussion started by: Sharma331
15 Replies
DateTime::Locale::sid(3)				User Contributed Perl Documentation				  DateTime::Locale::sid(3)

NAME
DateTime::Locale::sid SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'sid' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Sidamo. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) Sanyo Maakisanyo Roowe Hamuse Arbe Qidaame Sambata Abbreviated (format) San Mak Row Ham Arb Qid Sam Narrow (format) S M R H A Q S Wide (stand-alone) Sanyo Maakisanyo Roowe Hamuse Arbe Qidaame Sambata Abbreviated (stand-alone) San Mak Row Ham Arb Qid Sam Narrow (stand-alone) S M R H A Q S Months Wide (format) January February March April May June July August September October November December Abbreviated (format) Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Narrow (format) J F M A M J J A S O N D Wide (stand-alone) January February March April May June July August September October November December Abbreviated (stand-alone) Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Narrow (stand-alone) J F M A M J J A S O N D Quarters Wide (format) Q1 Q2 Q3 Q4 Abbreviated (format) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) Q1 Q2 Q3 Q4 Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated YIA YIG Narrow YIA YIG Date Formats Full 2008-02-05T18:30:30 = Maakisanyo, February 05, 2008 1995-12-22T09:05:02 = Arbe, December 22, 1995 -0010-09-15T04:44:23 = Qidaame, September 15, -10 Long 2008-02-05T18:30:30 = 05 February 2008 1995-12-22T09:05:02 = 22 December 1995 -0010-09-15T04:44:23 = 15 September -10 Medium 2008-02-05T18:30:30 = 05-Feb-2008 1995-12-22T09:05:02 = 22-Dec-1995 -0010-09-15T04:44:23 = 15-Sep--10 Short 2008-02-05T18:30:30 = 05/02/08 1995-12-22T09:05:02 = 22/12/95 -0010-09-15T04:44:23 = 15/09/-10 Default 2008-02-05T18:30:30 = 05-Feb-2008 1995-12-22T09:05:02 = 22-Dec-1995 -0010-09-15T04:44:23 = 15-Sep--10 Time Formats Full 2008-02-05T18:30:30 = 6:30:30 hawwaro UTC 1995-12-22T09:05:02 = 9:05:02 soodo UTC -0010-09-15T04:44:23 = 4:44:23 soodo UTC Long 2008-02-05T18:30:30 = 6:30:30 hawwaro UTC 1995-12-22T09:05:02 = 9:05:02 soodo UTC -0010-09-15T04:44:23 = 4:44:23 soodo UTC Medium 2008-02-05T18:30:30 = 6:30:30 hawwaro 1995-12-22T09:05:02 = 9:05:02 soodo -0010-09-15T04:44:23 = 4:44:23 soodo Short 2008-02-05T18:30:30 = 6:30 hawwaro 1995-12-22T09:05:02 = 9:05 soodo -0010-09-15T04:44:23 = 4:44 soodo Default 2008-02-05T18:30:30 = 6:30:30 hawwaro 1995-12-22T09:05:02 = 9:05:02 soodo -0010-09-15T04:44:23 = 4:44:23 soodo Datetime Formats Full 2008-02-05T18:30:30 = Maakisanyo, February 05, 2008 6:30:30 hawwaro UTC 1995-12-22T09:05:02 = Arbe, December 22, 1995 9:05:02 soodo UTC -0010-09-15T04:44:23 = Qidaame, September 15, -10 4:44:23 soodo UTC Long 2008-02-05T18:30:30 = 05 February 2008 6:30:30 hawwaro UTC 1995-12-22T09:05:02 = 22 December 1995 9:05:02 soodo UTC -0010-09-15T04:44:23 = 15 September -10 4:44:23 soodo UTC Medium 2008-02-05T18:30:30 = 05-Feb-2008 6:30:30 hawwaro 1995-12-22T09:05:02 = 22-Dec-1995 9:05:02 soodo -0010-09-15T04:44:23 = 15-Sep--10 4:44:23 soodo Short 2008-02-05T18:30:30 = 05/02/08 6:30 hawwaro 1995-12-22T09:05:02 = 22/12/95 9:05 soodo -0010-09-15T04:44:23 = 15/09/-10 4:44 soodo Default 2008-02-05T18:30:30 = 05-Feb-2008 6:30:30 hawwaro 1995-12-22T09:05:02 = 22-Dec-1995 9:05:02 soodo -0010-09-15T04:44:23 = 15-Sep--10 4:44:23 soodo Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 Mak 1995-12-22T09:05:02 = 22 Arb -0010-09-15T04:44:23 = 15 Qid Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 hawwaro 1995-12-22T09:05:02 = 9:05 soodo -0010-09-15T04:44:23 = 4:44 soodo Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 hawwaro 1995-12-22T09:05:02 = 9:05:02 soodo -0010-09-15T04:44:23 = 4:44:23 soodo M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = Mak, 2-5 1995-12-22T09:05:02 = Arb, 12-22 -0010-09-15T04:44:23 = Qid, 9-15 MMdd (dd/MM) 2008-02-05T18:30:30 = 05/02 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/09 MMM (LLL) 2008-02-05T18:30:30 = Feb 1995-12-22T09:05:02 = Dec -0010-09-15T04:44:23 = Sep MMMd (MMM d) 2008-02-05T18:30:30 = Feb 5 1995-12-22T09:05:02 = Dec 22 -0010-09-15T04:44:23 = Sep 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = Mak Feb 5 1995-12-22T09:05:02 = Arb Dec 22 -0010-09-15T04:44:23 = Qid Sep 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = February 5 1995-12-22T09:05:02 = December 22 -0010-09-15T04:44:23 = September 15 MMMMdd (dd MMMM) 2008-02-05T18:30:30 = 05 February 1995-12-22T09:05:02 = 22 December -0010-09-15T04:44:23 = 15 September MMMMEd (E MMMM d) 2008-02-05T18:30:30 = Mak February 5 1995-12-22T09:05:02 = Arb December 22 -0010-09-15T04:44:23 = Qid September 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = Mak, 2008-2-5 1995-12-22T09:05:02 = Arb, 1995-12-22 -0010-09-15T04:44:23 = Qid, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 Feb 1995-12-22T09:05:02 = 1995 Dec -0010-09-15T04:44:23 = -10 Sep yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = Mak, 2008 Feb 5 1995-12-22T09:05:02 = Arb, 1995 Dec 22 -0010-09-15T04:44:23 = Qid, -10 Sep 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 February 1995-12-22T09:05:02 = 1995 December -0010-09-15T04:44:23 = -10 September yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 Q1 1995-12-22T09:05:02 = 1995 Q4 -0010-09-15T04:44:23 = -10 Q3 yyMM (MM/yy) 2008-02-05T18:30:30 = 02/08 1995-12-22T09:05:02 = 12/95 -0010-09-15T04:44:23 = 09/-10 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = February 2008 1995-12-22T09:05:02 = December 1995 -0010-09-15T04:44:23 = September -10 Miscellaneous Prefers 24 hour time? No Local first day of the week Sanyo SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.16.2 2013-08-25 DateTime::Locale::sid(3)
All times are GMT -4. The time now is 11:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy