GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
time.cc File Reference
#include <string>
#include "defun.h"
#include "error.h"
#include "oct-map.h"
#include "oct-time.h"
#include "ov.h"
#include "ovl.h"
Include dependency graph for time.cc:

Go to the source code of this file.

Functions

static octave::sys::base_tm extract_tm (const octave_scalar_map &m, const char *who)
 
OCTAVE_EXPORT octave_value_list Fstrptime (const octave_value_list &args, int) ar
 
OCTAVE_EXPORT octave_value_list Ftime (const octave_value_list &args, int) on Monday February 17
 
for fields that display a single padding can be changed or inhibited by following the hour (hh:mm). tem %s Time in seconds since 00
 
for fields that display a single padding can be changed or inhibited by following the hour (hh:mm:ss [AP]M). tem %R Time
 
static int intfield (const octave_scalar_map &m, const std::string &k, const char *who)
 
static octave_scalar_map mk_tm_map (const octave::sys::base_tm &t)
 
static std::string stringfield (const octave_scalar_map &m, const std::string &k, const char *who)
 

Variables

for fields that display a single padding can be changed or inhibited by following the amp {%} with one of the modifiers described below. Unknown field specifiers are copied as normal characters. All other characters are copied to the output without change. For example: xample roup strftime ("%r (%Z) %A %e %B %Y", localtime (time ())) esult{} "01:15:06 AM (CST) Monday 17 February 1997" nd group nd example Octave's @code{strftime} function supports a superset of the ANSI C field specifiers. @noindent Literal character fields: @table @code @item %% % character. @item %n Newline character. @item %t Tab character. @end table @noindent Numeric modifiers (a nonstandard extension): @table @code @item - (dash) Do not pad the field. @item _ (underscore) Pad the field with spaces. @end table @noindent Time fields: @table @code @item %H Hour (00-23). @item %I Hour (01-12). @item %k Hour (0-23). @item %l Hour (1-12). @item %M Minute (00-59). @item %p Locale's AM or PM. tem %r Time
 
OCTAVE_EXPORT octave_value_list at
 
numeric fields are padded if necessary Padding is with zeros by default
 
for fields that display a single number
 
OCTAVE_EXPORT octave_value_list the value returned by ode
 
 otherwise =} strptime (ar{str}, ar{fmt}) Convert the string ar{str} to the time structure ar{tm_struct} under the control of the format string ar{fmt}. If ar{fmt} fails to match, ar{nchars} is 0
 

Function Documentation

◆ extract_tm()

◆ Fstrptime()

OCTAVE_EXPORT octave_value_list Fstrptime ( const octave_value_list args,
int   
)

Definition at line 478 of file time.cc.

◆ Ftime()

OCTAVE_EXPORT octave_value_list Ftime ( const octave_value_list args,
int   
)

◆ hour() [1/2]

for fields that display a single padding can be changed or inhibited by following the hour ( hh:mm  )

Definition at line 441 of file time.cc.

◆ hour() [2/2]

for fields that display a single padding can be changed or inhibited by following the hour ( hh:mm:ss  M[AP])

◆ intfield()

static int intfield ( const octave_scalar_map m,
const std::string k,
const char *  who 
)
inlinestatic

Definition at line 60 of file time.cc.

References octave_scalar_map::getfield(), octave_value::isempty(), k, retval, and octave_value::xint_value().

Referenced by extract_tm().

◆ mk_tm_map()

static octave_scalar_map mk_tm_map ( const octave::sys::base_tm t)
static

Definition at line 39 of file time.cc.

References octave_scalar_map::assign(), and t.

◆ stringfield()

static std::string stringfield ( const octave_scalar_map m,
const std::string k,
const char *  who 
)
inlinestatic

Variable Documentation

◆ amp

for fields that display a single padding can be changed or inhibited by following the amp {%} with one of the modifiers described below. Unknown field specifiers are copied as normal characters. All other characters are copied to the output without change. For example: xample roup strftime ("%r (%Z) %A %e %B %Y", localtime (time ())) esult{} "01:15:06 AM (CST) Monday 17 February 1997" nd group nd example Octave's @code{strftime} function supports a superset of the ANSI C field specifiers. @noindent Literal character fields: @table @code @item %% % character. @item %n Newline character. @item %t Tab character. @end table @noindent Numeric modifiers (a nonstandard extension): @table @code @item - (dash) Do not pad the field. @item _ (underscore) Pad the field with spaces. @end table @noindent Time fields: @table @code @item %H Hour (00-23). @item %I Hour (01-12). @item %k Hour (0-23). @item %l Hour (1-12). @item %M Minute (00-59). @item %p Locale's AM or PM. tem %r Time

Definition at line 441 of file time.cc.

◆ at

◆ default

numeric fields are padded if necessary Padding is with zeros by default

Definition at line 441 of file time.cc.

Referenced by Emulation::receiveChar(), and Vt102Emulation::tau().

◆ number

◆ ode

OCTAVE_EXPORT octave_value_list the value returned by ode

Definition at line 115 of file time.cc.

◆ otherwise

otherwise =} strptime (ar{str}, ar{fmt}) Convert the string ar{str} to the time structure ar{tm_struct} under the control of the format string ar{fmt}. If ar{fmt} fails to match, ar{nchars} is 0

Definition at line 478 of file time.cc.