hk_datetime

Transforms date and/or time formats to any other format

Inherits from hk_class.

set_date(day,month,year)

sets the date as numbers

set_time(hour,minute,second)

sets the time as numbers

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

sets the date and the time as numbers

set_date_asstring(s)

sets the date as a string formatted as set in set_dateformat

set_time_asstring(s)

sets the time as a string formatted as set in set_timeformat

set_datetime_asstring(s)

sets the datetime as a string formatted as set in set_datetimeformat

date_asstring()

returns the date as a string formatted as set in set_dateformat

datetime_asstring()

returns the datetime as a string formatted as set in set_datetimeformat

time_asstring()

returns the time as a string formatted as set in set_timeformat

set_dateformat(f)

Any 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 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

set_timeformat(f)

Any 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 : "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

set_datetimeformat(f)

Any 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

day()

returns the day

month()

returns the month

year()

returns the year

hour()

returns the hour

minute()

returns the minute

second()

returns the second

difference(datetime)

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