WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Date.h
1#ifndef _WINC_DATE
2#define _WINC_DATE
3
4#include <WXP/DateVal.h>
5#include <WXP/String.h>
6
7namespace WXP {
8 class Date : private DateVal {
9 int wday;
10 int jday;
11 long secs;
12 int off;
13 char zone[5];
15 int computeSecs();
16
17 public:
18 Date();
19 Date( int ryear, int rmonth, int rday, int rhour, int rmin, float rsec );
20 Date( DateVal &date );
21 Date( long secs );
22 Date( char *str );
23 int operator>( const Date &date );
24 int operator<( const Date &date );
25 void operator+=( const int rsecs );
26 int init();
27 bool isSet();
28 int set( const char *str );
29 int set( int ryear, int rmonth, int rday, int rhour, int rmin, float rsec );
31 inline int set( Date &rdate ){ *this = rdate; return 1; };
32 int set( DateVal &date );
33 int set( DateVal &date, int roff, const char *tz );
34 int set( long secs );
35 int set();
36 int getVals( DateVal &date );
37 DateVal get();
38 int setYear( int val );
40 inline int getYear(){ return year; };
41 int getYear00();
42 int setMonth( int val );
44 inline int getMonth(){ return month; };
45 int setDay( int val );
47 inline int getDay(){ return day; };
48 int setHour( int val );
50 inline int getHour(){ return hour; };
51 int setMinute( int val );
53 inline int getMinute(){ return min; };
54 int setSecond( float val );
55 int setFractionalSecond( float val );
57 inline float getSecond(){ return sec; };
58 int getSeconds();
59 bool isLeap();
60 int setDays( int days );
61 int setTime( int rhour, int rmin, float rsec );
62 int setTime( float rsecs );
63 int getDays();
64 int addYears( int years );
65 int addMonths( int months );
66 int addDays( int days );
67 int addHours( int hours );
68 int addMinutes( int mins );
69 int addSeconds( float secs );
70 int getDayOfWeek();
71 int getJulian();
72 int setJulian( int val );
73 int toString( String &str );
74 int toText( String &str );
75 int toText( const char *form, String &str );
76 int changeTimezone( int roff, const char *tz );
77 int adjustMinute( int rmonth, int rday, int rhour, int rmin );
78 int adjustMinute( int rday, int rhour, int rmin );
79 int adjustMinute( int rhour, int rmin );
80 int adjustSecond( int rhour, int rmin, int rsec );
81 int adjustHour( int rmonth, int rday, int rhour );
82 int adjustHour( int rday, int rhour );
83 int adjustHour( int rhour );
84 int fix();
85 int print();
86 int printSeconds();
87
88 static long getCurrentSeconds();
89 static bool isYearLeap( int year );
90 static int setJulian( int year, int jday, int &month, int &day );
91 static int getJulian( int year, int month, int day );
92 };
93}
94
95#endif
This class stores date and time information.
Definition Date.h:8
int setTime(int rhour, int rmin, float rsec)
Definition Date.cc:233
float getSecond()
Definition Date.h:57
int addHours(int hours)
Definition Date.cc:549
int getSeconds()
Definition Date.cc:363
int addDays(int days)
Definition Date.cc:527
int setDays(int days)
Definition Date.cc:465
int setHour(int val)
Definition Date.cc:320
int set(Date &rdate)
Definition Date.h:31
int addMinutes(int mins)
Definition Date.cc:571
int addYears(int years)
Definition Date.cc:499
int getDay()
Definition Date.h:47
int fix()
Definition Date.cc:849
int getDayOfWeek()
Definition Date.cc:623
int printSeconds()
Definition Date.cc:896
int getMonth()
Definition Date.h:44
Date()
Definition Date.cc:26
int getVals(DateVal &date)
Definition Date.cc:247
int getJulian()
Definition Date.cc:615
int getMinute()
Definition Date.h:53
static bool isYearLeap(int year)
Definition Date.cc:384
int setMinute(int val)
Definition Date.cc:331
int toText(String &str)
Definition Date.cc:915
int changeTimezone(int roff, const char *tz)
Definition Date.cc:687
int toString(String &str)
Definition Date.cc:906
int setSecond(float val)
Definition Date.cc:342
int adjustMinute(int rmonth, int rday, int rhour, int rmin)
Definition Date.cc:732
int addMonths(int months)
Definition Date.cc:509
static long getCurrentSeconds()
Definition Date.cc:373
int init()
Definition Date.cc:86
bool isLeap()
Definition Date.cc:397
int print()
Definition Date.cc:862
int getDays()
Definition Date.cc:418
int getHour()
Definition Date.h:50
int getYear00()
Definition Date.cc:289
int setMonth(int val)
Definition Date.cc:298
int adjustHour(int rmonth, int rday, int rhour)
Definition Date.cc:767
int setFractionalSecond(float val)
Definition Date.cc:353
DateVal get()
Definition Date.cc:261
int getYear()
Definition Date.h:40
bool isSet()
Definition Date.cc:100
int set()
Definition Date.cc:129
int adjustSecond(int rhour, int rmin, int rsec)
Definition Date.cc:718
int setYear(int val)
Definition Date.cc:276
int setJulian(int val)
Definition Date.cc:631
int setDay(int val)
Definition Date.cc:309
int addSeconds(float secs)
Definition Date.cc:593
This is a variable length string class.
Definition String.h:5
All WXP classes fall under the WXP namespace.
Definition Angle.h:4
This struct defines basic date values.
Definition DateVal.h:5
int year
Definition DateVal.h:6
float sec
Definition DateVal.h:11
int month
Definition DateVal.h:7
int min
Definition DateVal.h:10
int day
Definition DateVal.h:8
int hour
Definition DateVal.h:9