Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add time to date to make DateTime
Message
From
02/02/2017 19:00:43
 
 
To
02/02/2017 17:55:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01647380
Message ID:
01647387
Views:
38
*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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform