Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

dsDate.C File Reference

#include <dsDate.h>


time_t dt_convert (const char *format, istream &is)
time_t dt_convert (const char *format, const char *src)
ostream & dt_format (ostream &dest, char *format, time_t t)
char * dt_format (char *dest, int max_size, char *format, time_t t)
int dt_interval (char *src, char **newptr)
time_t dt_round (time_t t, char *what)
time_t dt_nearest (int year, int mon, int mday, int wday, int hour, int min)


char * monts [14]

Function Documentation

time_t dt_convert const char *    format,
const char *    src

time_t dt_convert const char *    format,
std::istream &    is

convert string to date according to format specified format descripption: YY - two digit year YYYY - four digit year MM - two digit month Aaa - Abreviated Three-letter month DD - two digid mday dd - one or two digit mday (mail style) hh,mm,ss - time hoursi (24h), minits, secons

' '(space) - skip all white spaces '.'(dot) - skip any character at this position ';'(semicolon) - remove rest of input

char* dt_format char *    dest,
int    max_size,
char *    format,
time_t    t

todo: make it real function

ostream& dt_format std::ostream &    dest,
char *    format,
time_t    time

convert timestamp to string according to format specified, very close to strftime, but use time_t instead of struct tm and format specified as for dt_convert

int dt_interval char *    src,
char **    newptr = 0

convert interval to sec from 1h60m30s notation

time_t dt_nearest int    year,
int    mont,
int    mday,
int    wday,
int    hour = -1,
int    min = -1

return date nearest to passed, if you specify wday it return nearest date after specified or today with matching wday

-1 means '*' wday = 0 to 6 (if defined WEEK_START_MON 0 means MON else SUN) mon = 1 to 12 year should be with century (e.g. 2003);

time_t dt_round time_t    t,
char *    what = "-d"

return date part of date_time -d = to day down +d to day up -w = to week down +d to week up -m = to month down +m to month up

Variable Documentation

char* monts[14]

Initial value:

 {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" }

Generated on Mon May 16 18:26:58 2005 for libdms4 by doxygen1.3-rc2