| www.delorie.com/gnu/docs/gcal/gcal_76.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
%[format]? special texts The use of the other difference values as listed here is to calculate distance values between two dates. In case these special texts are directly lead by a `-' character, e.g. `-%d', Gcal switches the sign of the computed value.
You may depreciate the special meaning of the `-' character ---in case this character itself is needed-- by placing a `\' (backslash) character before it, e.g. `\-'. If you need the `\-' characters themselves, you have to protect the `\' (backslash) character by another `\' (backslash) character, e.g. `\\-'.
The following other difference values %[format]?
special texts are respected:
%d
The resource file line `0 %d days gone' will be expanded to
==> `-10 days gone', in case you call Gcal with the `-c10-' option and no command.
%w
%m
%y
An example:
Supposing, the actual system date is the 4th September 1999. To calculate, how many days, weeks, months and years are between the actual system date and the birthday of a person, who is born on 21st September 1962, Gcal can be called as follows:
$ gcal -f/dev/null -Ux -u -#'19620921 %y %m %w %d~' 1962 -| -| -37 -444 -1928 -13497 -| $ gcal -f/dev/null -Ux -u -#'19620921 \\-%y \-%m %w -%d~' 1962 -| -| \--37 --444 -1928 13497 -| $ gcal -f/dev/null -Ux -u -#'00000904 %y %m %w %d~' %19620921 1999 -| -| 37 444 1928 13497 -| $ gcal -f/dev/null -Ux -u -#'00000904 %y %B19620921' %19620921 1962 -| -| 37 36 |
Please do not confound the relative year number %[format]y
special text with the age value %B special text
(see section Age value %[format]B[date] special text).
The %y special text counts started years as complete years,
while the %B special text does not.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |