Date, time arithmetic, math
1) gnu date
2) ksh ( version 93, not 88; ksh93 M 93t+ ) printf, e.g:
printf "%(%Y-%m-%d)T\n" "yesterday"
Many more examples ( as of 2017.07 ):
http://blog.fpmurphy.com/2008/10/ksh93-date-manipulation.html
3) date.pl (perl, limited arithmetic, but "date.pl -d '- 1 day'" works)
( https://www.unix.com/tips-tutorials/239167-general-purpose-date-script.html )
4) dconv et al, e.g. ddiff, dconv, strptime (parsing), etc.
( dateutils: http://www.fresse.org/dateutils/ )
5) tm2tm (c, OK in 32-bit; fails to compile in 64-bit)
( https://www.unix.com/shell-programming-scripting/146216-date-difference-between-freebsd-linux.html#post302463136 )
6) perl custom formatting (with function POSIX::strftime, "perldoc POSIX")
Generally, see http://search.cpan.org/search?query=date&mode=all
7) date-cpan.pl, cpan perl date
( http://cpansearch.perl.org/src/CWEST/ppt-0.14/src/date/date.jgross )
8) For small changes, say, "yesterday" in bash, ksh
TZ=CST+24 date +%Y%m%d
csh, tcsh
setenv TZ CST+24 ; date +%Y%m%d
9) Check for legal date:
manstat:validata ( http://oldwww.acm.org/perlman/stat/ )
10) Check for legal date:
validate (local perl code)
11) Shell, ksh, date calculations:
www.unix.com/unix-for-dummies-questions-and-answers/4870-days-elapsed-between-2-dates.html
Hello, using date, we can easily get today's date
$ date +%y-%m-%d
06-12-08
is it possible for me to get yesterday's date using 'date', if not, is there any quick and easy way to do that?
Thanks! (1 Reply)
I am not using GNU nor BSD. On AIX, how do you return yesterday in the format of i.e. "May 09" with a space.
# `TZ=y380 date +%h""%d`
>> May09
# `TZ=y380 date +%h" "%d`
>> May
I appreciate your help in advance.
thx (3 Replies)
I haven't been using linux very long( and when I say that its only been about 1 week for me) I was told to do the following:
Create a Bash script that will copy all the files and subdirectories in one directory to a newly created directory. You may name the receiving directory anything you like.... (4 Replies)
I was playing to find a simple way to get yesterday's date, and came up with this (on an AIX 5.2 box):
$ date
Thu Feb 19 11:21:26 EST 2009
$ echo $TZ
EST5EDT
$ yesterday=`TZ=$(date +%Z)+24 date`
$ echo $yesterday
Wed Feb 18 16:21:52 GMT 2009
Why it is converted to GMT instead of... (2 Replies)
Hi,
`date` command will give the current days date.
Is there any command to get the previous day date?
I need the previous day value in my script.
Ahamed. (1 Reply)
HI All,
I am trying so long to find the yesterday's date to run a script but i failed
kinldy share the command to find yesterday's date in ksh
i tried with
date --date='1 day ago'
but it displaying error
your help will highly apeerciated.
Thanks (7 Replies)
Hi Friend,
i am using OS
HP-UX vvftf320 B.11.11 U 9000/800 511076331 unlimited-user license
now i have used below command but it giving today's date. i need your help to get yesterdate. Please correct me.
date +"%d%m%Y%H%M%S" -d "1 days ago
Thanks in advance,
Jewel (3 Replies)
Discussion started by: Jewel
3 Replies
LEARN ABOUT DEBIAN
paps
PAPS(1) General Commands Manual PAPS(1)NAME
paps - UTF-8 to PostScript converter using Pango
SYNOPSIS
paps [options] files...
DESCRIPTION
paps reads a UTF-8 encoded file and generates a PostScript language rendering of the file. The rendering is done by creating outline curves
through the pango ft2 backend.
OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is
included below.
--landscape
Landscape output. Default is portrait.
--columns=cl
Number of columns output. Default is 1.
Please notice this option isn't related to the terminal length as in a "80 culums terminal".
--font=desc
Set the font description. Default is Monospace 12.
--rtl Do right to left (RTL) layout.
--paper ps
Choose paper size. Known paper sizes are legal, letter and A4. Default is A4.
Postscript points
Each postscript point equals to 1/72 of an inch. 36 points are 1/2 of an inch.
--bottom-margin=bm
Set bottom margin. Default is 36 postscript points.
--top-margin=tm
Set top margin. Default is 36 postscript points.
--left-margin=lm
Set left margin. Default is 36 postscript points.
--right-margin=rm
Set right margin. Default is 36 postscript points.
--gutter-width=gw
Set gutter width. Default is 40 postscript points.
--help Show summary of options.
--header
Draw page header for each page.
--markup
Interpret the text as pango markup.
--lpi Set the lines per inch. This determines the line spacing.
--cpi Set the characters per inch. This is an alternative method of specifying the font size.
--stretch-chars
Indicates that characters should be stretched in the y-direction to fill up their vertical space. This is similar to the texttops
behaviour.
AUTHOR
paps was written by Dov Grobgeld <dov.grobgeld@gmail.com>.
This manual page was written by Lior Kaplan <kaplan@debian.org>, for the Debian project (but may be used by others).
April 17, 2006 PAPS(1)