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:02:34
 
 
To
02/02/2017 19:00:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01647380
Message ID:
01647388
Views:
28
>*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.

Thank you!
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform