class hk_datetime

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

Internal Use Only
Definition#include <hk_classes/hk_classes/hk_datetime.h>
Inheritshk_class [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods


Detailed Description

This class transforms date and/or time formats to any other format

 hk_datetime (void)

hk_datetime

 hk_datetime (const hk_datetime&)

hk_datetime

 ~hk_datetime (void)

~hk_datetime

[virtual]

bool  set_date ( int day, int month, int year)

set_date

sets the date

bool  set_time ( int hour, int minute, int second)

set_time

sets the time

bool  set_datetime ( int day, int month, int year, int hour, int minute, int second)

set_datetime

sets date and time

bool  set_date_asstring (const hk_string& s)

set_date_asstring

sets the date.

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

bool  set_time_asstring (const hk_string& s)

set_time_asstring

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

bool  set_datetime_asstring (const hk_string& s)

set_datetime_asstring

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

hk_string  date_asstring (void)

date_asstring

[const]

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

hk_string  time_asstring (void)

time_asstring

[const]

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

hk_string  datetime_asstring (void)

datetime_asstring

[const]

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

void  set_dateformat (const hk_string& f)

set_dateformat

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

void  set_timeformat (const hk_string& f)

set_timeformat

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

void  set_datetimeformat (const hk_string& f)

set_datetimeformat

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

int  day ()

day

[const]

int  month ()

month

[const]

int  year ()

year

[const]

int  hour ()

hour

[const]

int  minute ()

minute

[const]

int  second ()

second

[const]

void  set_now (void)

set_now

sets the current date and time

bool  operator= (const hk_datetime&)

operator=

bool  operator== (const hk_datetime&)

operator==

bool  operator!= (const hk_datetime&)

operator!=

bool  operator> (const hk_datetime&)

operator>

bool  operator>= (const hk_datetime&)

operator>=

bool  operator< (const hk_datetime&)

operator<

bool  operator<= (const hk_datetime&)

operator<=

double  difference (const hk_datetime& d)

difference

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

bool  is_ok_date ( int day, int month, int year)

is_ok_date

[protected]

bool  is_ok_time ( int hour, int minute, int second)

is_ok_time

[protected]