CLIP home page
Class DATETIME
This object/structure have data of year,month,day,hour,min,sec,msec.
Sample for function-orientired programming:
x:=dt_create(date(),"11:22:33:44")
? dt_date(x), dt_time(x)
? dt_year(x), dt_month(x), dt_day(x), dt_hour(x),dt_min(x),dt_sec(x),dt_msec(x)
x2:=dt_create("0000/00/00","101:102:103:1024")
? dt_date(x2), dt_time(x2)
dt_normalize(@x2)
? dt_date(x2), dt_time(x2)
x3:=dt_add(x,x2)
? dt_date(x3), dt_time(x3)
x3:=dt_sub(x,x2)
? dt_date(x3), dt_time(x3)
Sample for object-orientired programming:
x:=dateTimeNew(date(),"11:22:33:44")
? x:date(), x:time(x)
? x:year(), x:month(), x:day(), x:hour(),x:min(),x:sec(),x:msec()
x2:=dateTimeNew("0000/00/00","101:102:103:1024")
? x2:date(), x2:time()
x2:normalize()
? x2:date(), x2:time()
x3:=x:add(x2)
? x3:date(), x3:time()
x3:=x:sub(x2)
? x3:date(), x3:time()
Function description
dt:=dt_create(date(),time() )
dt:=dt_create(date() | "yyyy/mm/dd", nHour, nMin, nSec, nMsec )
dt:=dt_create(nYear, nMonth, nDay, nHour, nMin, nSec, nMsec )
Create and return new structure of datetime.
dVar:=dt_date(dt)
Return date from datetime.
sVar:=dt_time(dt)
Return time from datetime in format "hh:mm:ss:ms".
dt_year(dt), dt_month(dt), dt_day(dt), dt_hour(dt), dt_min(dt), dt_sec(dt), dt_msec(dt)
Return info of subdata.
dt2:=dt_normalize(@dt)
Noramlized data. Return new value.
dt3:=dt_add(dt1,dt2)
Return addittive value of two datetime.
dt3:=dt_sub(dt1,dt2)
Return result of subtract two datetime.
Decription of class DATETIME
This class don`t have attributes.
Methods
dt:=dateTimeNew(date(),time() )
dt:=dateTimeNew(date() | "yyyy/mm/dd", nHour, nMin, nSec, nMsec )
dt:=dateTimeNew(nYear, nMonth, nDay, nHour, nMin, nSec, nMsec )
Created and return new object.
dt:date()
Return date from datetime.
dt:time()
Return time from datetime in format "hh:mm:ss:ms".
dt:year(), dt:month(), dt:day(), dt:hour(), dt:min(), dt:sec(), dt:msec()
Return subdata.
dt:normalize()
Normalized object.
dt3:=dt1:add(dt2)
Return addittive value of two datetime.
dt3:=dt1:sub(dt2)
Return result of subtract two datetime.
CLIP home page
© Khnykin Uri uri@itk.ru, 2000