From octave-sources-request at bevo dot che dot wisc dot edu Mon Jan 27 14:10:47 2003 Subject: Some more functions - time - today.m From: Stefan Burger To: octave-sources at bevo dot che dot wisc dot edu Date: Mon, 27 Jan 2003 08:13:05 -0600 --------------Boundary-00=_C7MDT77SDCVU4SV6QB9I Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello again,=20 some more functions I want to share. These are time or calendar functions, as they exist also apparently=20 in the Matlab financial toolbox (according to their online docs. As I don't own Matlab myself, much less the financial toolbox,=20 these files are not tainted by copyright issues.) These functions are useful for calculating time periods for interest=20 calculations.=20 Functions: (separate mails) =09today (attached) =09yeardays =09year =09month =09day =09hour =09minute =09second. Best regards,=20 Stefan Burger. --------------Boundary-00=_C7MDT77SDCVU4SV6QB9I Content-Type: text/plain; charset="us-ascii"; name="today.m" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="today.m" ## Copyright (C) 2003 Stefan Burger ## ## This file is part of Octave. ## ## Octave is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by the ## Free Software Foundation; either version 2, or (at your option) any ## later version. ## ## Octave is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## for more details. ## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, write to the Free ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.. ## ## -*- texinfo -*- ## at deftypefn {Function File} {} today () ## Returns the current date (and date only) as a date value, ## i.e. w/o fractions for time of day. ## Uses clock to get current date and time. ## ## at end deftypefn ## at seealso{clock, datenum, datevec and now.) ## Author: Stefan Burger ## Description: Returns the current date value (w/o fractions). function today_val = today() clock_val = clock(); today_val = datenum(clock_val(1), clock_val(2), clock_val(3)); endfunction --------------Boundary-00=_C7MDT77SDCVU4SV6QB9I--