#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <iostream>
#include <dsSmartException.h>
#include <dsform.h>
Go to the source code of this file.
Defines | |
#define | BASE_YEAR 70 |
#define | MAX_YEAR 3100 |
#define | YEAR_OFFS 1900 |
#define | LAST_MON 11 |
#define | LAST_MDAY 31 |
#define | LAST_HOUR 23 |
#define | LAST_MIN 59 |
#define | LAST_SEC 59 |
#define | WEEK_STARTS_MON |
#define | DF_CTIME "... Aaa dd hh:mm:ss YYYY" |
#define | DF_EUDATE "DD/MM/YY hh:mm:ss" |
#define | DF_EUDATEL "DD/MM/YYYY hh:mm:ss" |
#define | DF_USDATE "MM/DD/YY hh:mm:ss" |
#define | DF_USDATEL "MM/DD/YYYY hh:mm:ss" |
Functions | |
DECLARE_EXCEPTION (dsDate) | |
time_t | dt_convert (const char *format, std::istream &is) |
time_t | dt_convert (const char *format, const char *in) |
time_t | dt_convert (std::istream &is, const char *format) |
std::ostream & | dt_format (std::ostream &dest, char *format, time_t time) |
char * | dt_format (char *dest, int max_size, char *format, time_t t) |
int | dt_interval (char *src, char **newptr=0) |
time_t | dt_round (time_t t, char *what="-d") |
time_t | dt_nearest (int year, int mont, int mday, int wday, int hour=-1, int min=-1) |
time_t | dt_nearest (struct tm *tm) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|
todo: make it real function |
|
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 |
|
convert interval to sec from 1h60m30s notation |
|
|
|
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); |
|
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 |