Sponsored Content
Top Forums UNIX for Dummies Questions & Answers using 'date' to get previous days' dates Post 302206443 by fpmurphy on Tuesday 17th of June 2008 08:49:53 PM
Old 06-17-2008
If you are using ksh93, the following works. Unfortunately not yet available in bash or zsh.
Code:
$ printf "%(%Y-%m-%d)T\n" "1 day ago"
2008-06-16
$ printf "%(%Y-%m-%d)T\n" "2 days ago"
2008-06-15
$

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

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. (1 Reply)
Discussion started by: rkkiran
1 Replies

2. 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

3. UNIX for Dummies Questions & Answers

Dates of previous years

Is there any way to use date with previous dates such as "2 23 2000" in order to see what day of the week it was? I tried changing the current date to "date 022300452000" but then it told me that I could not do this because I was "Not the owner". Any other ways of getting the day result? (2 Replies)
Discussion started by: terms5
2 Replies

4. UNIX for Dummies Questions & Answers

print all dates 100 days from current date

can anyone please suggest me on ideas to write a script which has to go back to 100 days from 'current date' and print the date of each day starting from 100th day to current day. (korn shell please) Thanks Pavan (5 Replies)
Discussion started by: pavan_test
5 Replies

5. UNIX for Dummies Questions & Answers

Append Previous Days date to filename

I need to append previous days date to my file which is generated using a script. I am working on Solaris 10. Thanks! (2 Replies)
Discussion started by: Twisha
2 Replies

6. 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

7. Shell Programming and Scripting

Can i get the previous/next days date of a selected day

Ok, the title is confusing i know, but it is a weird question. I have a bash script running on Centos5.8 and want to find a better way to do some date manipulation. What i am trying to do is get 3 days of files (day before, that day, and day after), concatenate the three files and pass them on... (2 Replies)
Discussion started by: oly_r
2 Replies

8. 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

9. Shell Programming and Scripting

Display previous days dates in ksh

---------- Post updated at 03:42 AM ---------- Previous update was at 03:38 AM ---------- Sorry for a duplicate post, my post at the first place could not appear due to some net issue on my machine. Here is what i posted earlier: Hi, i am using ksh in Solaris, i wanted to assign today's,... (5 Replies)
Discussion started by: pr5439
5 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
DateTime::Locale::it(3) 				User Contributed Perl Documentation				   DateTime::Locale::it(3)

NAME
DateTime::Locale::it SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'it' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Italian. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) lunedi martedi mercoledi giovedi venerdi sabato domenica Abbreviated (format) lun mar mer gio ven sab dom Narrow (format) L M M G V S D Wide (stand-alone) Lunedi Martedi Mercoledi Giovedi Venerdi Sabato Domenica Abbreviated (stand-alone) lun mar mer gio ven sab dom Narrow (stand-alone) L M M G V S D Months Wide (format) gennaio febbraio marzo aprile maggio giugno luglio agosto settembre ottobre novembre dicembre Abbreviated (format) gen feb mar apr mag giu lug ago set ott nov dic Narrow (format) G F M A M G L A S O N D Wide (stand-alone) Gennaio Febbraio Marzo Aprile Maggio Giugno Luglio Agosto Settembre Ottobre Novembre Dicembre Abbreviated (stand-alone) gen feb mar apr mag giu lug ago set ott nov dic Narrow (stand-alone) G F M A M G L A S O N D Quarters Wide (format) 1o trimestre 2o trimestre 3o trimestre 4o trimestre Abbreviated (format) T1 T2 T3 T4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1o trimestre 2o trimestre 3o trimestre 4o trimestre Abbreviated (stand-alone) T1 T2 T3 T4 Narrow (stand-alone) 1 2 3 4 Eras Wide a.C. d.C Abbreviated aC dC Narrow aC dC Date Formats Full 2008-02-05T18:30:30 = martedi 5 febbraio 2008 1995-12-22T09:05:02 = venerdi 22 dicembre 1995 -0010-09-15T04:44:23 = sabato 15 settembre -10 Long 2008-02-05T18:30:30 = 05 febbraio 2008 1995-12-22T09:05:02 = 22 dicembre 1995 -0010-09-15T04:44:23 = 15 settembre -10 Medium 2008-02-05T18:30:30 = 05/feb/2008 1995-12-22T09:05:02 = 22/dic/1995 -0010-09-15T04:44:23 = 15/set/-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/dic/1995 -0010-09-15T04:44:23 = 15/set/-10 Time Formats Full 2008-02-05T18:30:30 = 18.30.30 UTC 1995-12-22T09:05:02 = 09.05.02 UTC -0010-09-15T04:44:23 = 04.44.23 UTC Long 2008-02-05T18:30:30 = 18.30.30 UTC 1995-12-22T09:05:02 = 09.05.02 UTC -0010-09-15T04:44:23 = 04.44.23 UTC Medium 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 Short 2008-02-05T18:30:30 = 18.30 1995-12-22T09:05:02 = 09.05 -0010-09-15T04:44:23 = 04.44 Default 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 Datetime Formats Full 2008-02-05T18:30:30 = martedi 5 febbraio 2008 18.30.30 UTC 1995-12-22T09:05:02 = venerdi 22 dicembre 1995 09.05.02 UTC -0010-09-15T04:44:23 = sabato 15 settembre -10 04.44.23 UTC Long 2008-02-05T18:30:30 = 05 febbraio 2008 18.30.30 UTC 1995-12-22T09:05:02 = 22 dicembre 1995 09.05.02 UTC -0010-09-15T04:44:23 = 15 settembre -10 04.44.23 UTC Medium 2008-02-05T18:30:30 = 05/feb/2008 18.30.30 1995-12-22T09:05:02 = 22/dic/1995 09.05.02 -0010-09-15T04:44:23 = 15/set/-10 04.44.23 Short 2008-02-05T18:30:30 = 05/02/08 18.30 1995-12-22T09:05:02 = 22/12/95 09.05 -0010-09-15T04:44:23 = 15/09/-10 04.44 Default 2008-02-05T18:30:30 = 05/feb/2008 18.30.30 1995-12-22T09:05:02 = 22/dic/1995 09.05.02 -0010-09-15T04:44:23 = 15/set/-10 04.44.23 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 mar 1995-12-22T09:05:02 = 22 ven -0010-09-15T04:44:23 = 15 sab HHmm (HH.mm) 2008-02-05T18:30:30 = 18.30 1995-12-22T09:05:02 = 09.05 -0010-09-15T04:44:23 = 04.44 hhmm (hh.mm a) 2008-02-05T18:30:30 = 06.30 p. 1995-12-22T09:05:02 = 09.05 m. -0010-09-15T04:44:23 = 04.44 m. HHmmss (HH.mm.ss) 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 hhmmss (hh.mm.ss a) 2008-02-05T18:30:30 = 06.30.30 p. 1995-12-22T09:05:02 = 09.05.02 m. -0010-09-15T04:44:23 = 04.44.23 m. Hm (HH:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 p. 1995-12-22T09:05:02 = 9:05 m. -0010-09-15T04:44:23 = 4:44 m. 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 p. 1995-12-22T09:05:02 = 9:05:02 m. -0010-09-15T04:44:23 = 4:44:23 m. M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (d/M) 2008-02-05T18:30:30 = 5/2 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/9 MEd (EEE d/M) 2008-02-05T18:30:30 = mar 5/2 1995-12-22T09:05:02 = ven 22/12 -0010-09-15T04:44:23 = sab 15/9 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 = dic -0010-09-15T04:44:23 = set MMMd (d MMM) 2008-02-05T18:30:30 = 5 feb 1995-12-22T09:05:02 = 22 dic -0010-09-15T04:44:23 = 15 set MMMEd (EEE d MMM) 2008-02-05T18:30:30 = mar 5 feb 1995-12-22T09:05:02 = ven 22 dic -0010-09-15T04:44:23 = sab 15 set MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 febbraio 1995-12-22T09:05:02 = 22 dicembre -0010-09-15T04:44:23 = 15 settembre MMMMdd (dd MMMM) 2008-02-05T18:30:30 = 05 febbraio 1995-12-22T09:05:02 = 22 dicembre -0010-09-15T04:44:23 = 15 settembre MMMMEd (EEE d MMMM) 2008-02-05T18:30:30 = mar 5 febbraio 1995-12-22T09:05:02 = ven 22 dicembre -0010-09-15T04:44:23 = sab 15 settembre 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 (M/yyyy) 2008-02-05T18:30:30 = 2/2008 1995-12-22T09:05:02 = 12/1995 -0010-09-15T04:44:23 = 9/-010 yMEd (EEE, d-M-yyyy) 2008-02-05T18:30:30 = mar, 5-2-2008 1995-12-22T09:05:02 = ven, 22-12-1995 -0010-09-15T04:44:23 = sab, 15-9--010 yMMM (MMM y) 2008-02-05T18:30:30 = feb 2008 1995-12-22T09:05:02 = dic 1995 -0010-09-15T04:44:23 = set -10 yMMMEd (EEE d MMM y) 2008-02-05T18:30:30 = mar 5 feb 2008 1995-12-22T09:05:02 = ven 22 dic 1995 -0010-09-15T04:44:23 = sab 15 set -10 yMMMM (MMMM y) 2008-02-05T18:30:30 = febbraio 2008 1995-12-22T09:05:02 = dicembre 1995 -0010-09-15T04:44:23 = settembre -10 yQ (Q-yyyy) 2008-02-05T18:30:30 = 1-2008 1995-12-22T09:05:02 = 4-1995 -0010-09-15T04:44:23 = 3--010 yQQQ (QQQ y) 2008-02-05T18:30:30 = T1 2008 1995-12-22T09:05:02 = T4 1995 -0010-09-15T04:44:23 = T3 -10 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 yyQQQQ (QQQQ yy) 2008-02-05T18:30:30 = 1o trimestre 08 1995-12-22T09:05:02 = 4o trimestre 95 -0010-09-15T04:44:23 = 3o trimestre -10 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = febbraio 2008 1995-12-22T09:05:02 = dicembre 1995 -0010-09-15T04:44:23 = settembre -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week lunedi 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.3 2014-06-10 DateTime::Locale::it(3)
All times are GMT -4. The time now is 05:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy