Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

hk_datetime Class Reference

translates date and/or time values in different formats More...

#include <hk_datetime.h>

Inheritance diagram for hk_datetime:

hk_class List of all members.

Public Member Functions

 hk_datetime (void)
 hk_datetime (const hk_datetime &)
virtual ~hk_datetime (void)
bool set_date (int day, int month, int year)
bool set_time (int hour, int minute, int second)
bool set_datetime (int day, int month, int year, int hour, int minute, int second)
bool set_date_asstring (const hk_string &s)
bool set_time_asstring (const hk_string &s)
bool set_datetime_asstring (const hk_string &s)
hk_string date_asstring (void) const
hk_string time_asstring (void) const
hk_string datetime_asstring (void) const
void set_dateformat (const hk_string &f)
void set_timeformat (const hk_string &f)
void set_datetimeformat (const hk_string &f)
int day () const
int month () const
int year () const
int hour () const
int minute () const
int second () const
void set_now (void)
bool operator= (const hk_datetime &)
bool operator== (const hk_datetime &)
bool operator!= (const hk_datetime &)
bool operator> (const hk_datetime &)
bool operator>= (const hk_datetime &)
bool operator< (const hk_datetime &)
bool operator<= (const hk_datetime &)
double difference (const hk_datetime &d)

Protected Member Functions

bool is_ok_date (int day, int month, int year)
bool is_ok_time (int hour, int minute, int second)

Detailed Description

translates date and/or time values in different formats

Author:
Horst Knorr <hk_classes@knoda.org>
Version:
Revision
1.13


Constructor & Destructor Documentation

hk_datetime::hk_datetime void   ) 
 

hk_datetime::hk_datetime const hk_datetime  ) 
 

virtual hk_datetime::~hk_datetime void   )  [inline, virtual]
 


Member Function Documentation

hk_string hk_datetime::date_asstring void   )  const
 

Returns:
the date as a hk_string in the format as specified with set_dateformat

hk_string hk_datetime::datetime_asstring void   )  const
 

Returns:
the date and the time as a hk_string in the format as specified with set_datetimeformat

int hk_datetime::day  )  const [inline]
 

double hk_datetime::difference const hk_datetime d  ) 
 

returns the difference in seconds,negative values say that this object is contains a time before d;

int hk_datetime::hour  )  const [inline]
 

bool hk_datetime::is_ok_date int  day,
int  month,
int  year
[protected]
 

bool hk_datetime::is_ok_time int  hour,
int  minute,
int  second
[protected]
 

int hk_datetime::minute  )  const [inline]
 

int hk_datetime::month  )  const [inline]
 

bool hk_datetime::operator!= const hk_datetime  ) 
 

bool hk_datetime::operator< const hk_datetime  ) 
 

bool hk_datetime::operator<= const hk_datetime  ) 
 

bool hk_datetime::operator= const hk_datetime  ) 
 

bool hk_datetime::operator== const hk_datetime  ) 
 

bool hk_datetime::operator> const hk_datetime  ) 
 

bool hk_datetime::operator>= const hk_datetime  ) 
 

int hk_datetime::second  )  const [inline]
 

bool hk_datetime::set_date int  day,
int  month,
int  year
 

sets the date

bool hk_datetime::set_date_asstring const hk_string s  ) 
 

sets the date.

Parameters:
s contains the date as a hk_string in the format as specified with set_dateformat

void hk_datetime::set_dateformat const hk_string f  ) 
 

Any hk_string is valid. The values have to be separated with at least one character. The variables are D for the day M for the month Y for the year example : "D.M.Y" shows the 4th of November 2001 as 04.11.2001 and "Y-M-D" as 2001-11-04

bool hk_datetime::set_datetime int  day,
int  month,
int  year,
int  hour,
int  minute,
int  second
 

sets date and time

bool hk_datetime::set_datetime_asstring const hk_string s  ) 
 

Parameters:
s contains the date and time as a hk_string in the format as specified with set_datetimeformat

void hk_datetime::set_datetimeformat const hk_string f  ) 
 

Any hk_string is valid. The values have to be separated with at least one character. The variables are D for the day M for the month Y for the year h for the hour m for the minute s for the second example : "D.M.Y h:m:s" shows the 4th of November 2001 at noon as 04.11.2001 12:00:00 and "Y-M-D h/m" as 2001-11-04 12/00

void hk_datetime::set_now void   ) 
 

sets the current date and time

bool hk_datetime::set_time int  hour,
int  minute,
int  second
 

sets the time

bool hk_datetime::set_time_asstring const hk_string s  ) 
 

Parameters:
s contains the time as a hk_string in the format as specified with set_timeformat

void hk_datetime::set_timeformat const hk_string f  ) 
 

Any hk_string is valid. The values have to be separated with at least one character. The variables are h for the hour m for the minute s for the second example : "h:m:s" shows the noon as 12:00:00 and "h/m" as 12/00

hk_string hk_datetime::time_asstring void   )  const
 

Returns:
the time as a hk_string in the format as specified with set_timeformat

int hk_datetime::year  )  const [inline]
 


The documentation for this class was generated from the following file:
Generated on Thu Mar 9 18:40:41 2006 for hk_classes by  doxygen 1.4.1