*can replace date() with any valid date
local xyear,xmonth,xday,xhour,xmin,xsec
xyear=year(date())
xmonth=month(date())
xday=day(date())
xhour=int(val(substr(time(),1,2)))
xmin=int(val(substr(time(),3,2)))
xsec=int(val(substr(time(),7,2)))
local xdateTime
xdateTime= DATETIME(xyear,xmonth,xday,xhour,xmin,xsec )
messagebox(ttoc(xdateTime)+" type="+vartype(xdateTime))
*Returns the current date and time as a DateTime value, or creates a year 2000-compliant DateTime value.
*DATETIME([nYear, nMonth, nDay [, nHours [, nMinutes [, nSeconds]]]])
*Note
CTOT() can create ambiguous DateTime values and generates a compilation error when SET STRICTDATE is set to 2. To create nonambiguous Date values, use the DATETIME( ) function instead.