Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Data Types and Expressions > Expression >

TODAY Operator

Use the TODAY operator to return the system date as a DATE data type. If you specify TODAY as a default column value, the column must be a DATE column.

The following examples show how you might use the TODAY operator in an INSERT, UPDATE, or SELECT statement:

UPDATE orders (order_date) SET order_date = TODAY
    WHERE order_num = 1005 

INSERT INTO orders VALUES 
   (0, TODAY, 120, NULL, N, '1AUE217', NULL, NULL, NULL, NULL)

SELECT * FROM orders WHERE ship_date = TODAY

For Extended Parallel Server, the value returned by TODAY defaults to the date from the system clock-calendar, but you can specify instead the date from some other time zone. You can specify a time zone by using the SET ENVIRONMENT CLIENT_TZ statement of SQL (or by setting the IBM_XPS_PARAMS environment variable) to specify an offset from Greenwich Mean Time (GMT).

For code examples of setting non-default time zones, see CURRENT Operator. For information on how to set IBM_XPS_PARAMS, see the chapter on environment variables in the IBM Informix Guide to SQL: Reference.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]