GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • » Octave core
  • » by package
  • » alphabetical

This view

  • Original page
  • New address

GeezerVison is showing octave.sourceforge.io — Function Reference: datevec

Octave-Forge - Extra packages for GNU Octave
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code

Navigation

Operators and Keywords

Function List:

  • » Octave core
  • » by package
  • » alphabetical

C++ API

: v = datevec (date)
: v = datevec (date, f)
: v = datevec (date, p)
: v = datevec (date, f, p)
: [y, m, d, h, mi, s] = datevec (…)

Convert a serial date number (see datenum) or date string (see datestr) into a date vector.

A date vector is a row vector with six members, representing the year, month, day, hour, minute, and seconds respectively.

f is the format string used to interpret date strings (see datestr). If date is a string, but no format is specified, then a relatively slow search is performed through various formats. It is always preferable to specify the format string f if it is known. Formats which do not specify a particular time component will have the value set to zero. Formats which do not specify a date will default to January 1st of the current year.

p is the year at the start of the century to which two-digit years will be referenced. If not specified, it defaults to the current year minus 50.

See also: datenum, datestr, clock, now, date.

Demonstration 1

The following code

 ## Current date and time
 datevec (now ())

Produces the following output

ans =

   2017.0000      1.0000      2.0000     11.0000     55.0000     23.1812

Package: octave

SourceForge.net Logo
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.