Syntax 1: For creating DateTime values
Description
Combines a date value and a time value into a DateTime
value.
Syntax
|
1 |
DateTime ( date {, time } ) |
|
Argument |
Description |
|---|---|
|
date |
A value of type date. |
|
time (optional) |
A value of type time. If you omit time, PowerBuilder |
Return value
DateTime.
Returns a DateTime value based on the values in date and
optionally time. If any argument’s value is null, DateTime returns
null.
Usage
DateTime data is used only for reading and writing DateTime values
to and from a database. To use the date and time values in scripts, use
the Date and Time functions to assign values to date and time
variables.
Examples
These statements convert the date and time stored in ld_OrderDate
and lt_OrderTime to a DateTime value that can be used to update the
database:
|
1 2 3 4 5 6 7 8 |
DateTime ldt_OrderDateTime date ld_OrderDate time lt_OrderTime ld_OrderDate = Date(sle_orderdate.Text) lt_OrderTime = Time(sle_ordertime.Text) ldt_OrderDateTime = DateTime( & ld_OrderDate, lt_OrderTime) |
See also
DateTime method for DataWindows in the section called “DateTime” in DataWindow Reference