Mercurial > hg > octave-nkf
annotate scripts/time/date.m @ 11523:fd0a3ac60b0e
update copyright notices
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 14 Jan 2011 05:47:45 -0500 |
parents | 693e22af08ae |
children | d490ca8ab1a5 |
rev | line source |
---|---|
11523 | 1 ## Copyright (C) 1995-2011 John W. Eaton |
2313 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
2313 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
1183 | 18 |
3301 | 19 ## -*- texinfo -*- |
20 ## @deftypefn {Function File} {} date () | |
10793
be55736a0783
Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents:
8920
diff
changeset
|
21 ## Return the date as a character string in the form DD-MMM-YY@. For |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
22 ## example: |
3426 | 23 ## |
3301 | 24 ## @example |
25 ## @group | |
26 ## date () | |
27 ## @result{} "20-Aug-93" | |
28 ## @end group | |
29 ## @end example | |
30 ## @end deftypefn | |
1183 | 31 |
2314 | 32 ## Author: jwe |
33 | |
2311 | 34 function retval = date () |
1183 | 35 |
3191 | 36 retval = strftime ("%d-%b-%Y", localtime (time ())); |
1183 | 37 |
38 endfunction | |
7411 | 39 |
40 %!assert(strcmp (date (), strftime ("%d-%b-%Y", localtime (time ())))); | |
41 |