# 22. Virtuoso Functions Guide - now

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
datestring, ...
curdate
dateadd
datediff
datestring_gmt
dayname
dayofmonth
dayofweek
dayofyear
dt_set_tz
get_timestamp
getdate
hour
minute
month
monthname
msec_time
now
quarter
second
stringdate
stringtime
timezone
week
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
Functions Index

## now

returns the current transaction timestamp
now ();
Description

Now returns the timestamp associated with current transaction as a DATETIME. This value is guaranteed to differ from the timestamp of any other transaction.

Examples
Get a timestamp

Get a timestamp in human-readable form.

    SQL> select datestring(now()), cast (now() as VARCHAR);
    callret                   callret
    VARCHAR                   VARCHAR
    _______________________________________________________________________________

    2001-10-08 16:31:49.000000  2001-10-08 16:31:49.000000

    1 Rows. -- 99 msec.

Table example

Store update time in a column

    SQL> update test_table set TIME_CHANGED = now();

    Done. -- 37 msec.
    SQL> select cast (TIME_CHANGED as VARCHAR) from test_table;
    callret
    VARCHAR
    _______________________________________________________________________________

    2001-10-08 16:34:28.000000

    1 Rows. -- 3 msec.

Parameters

now has no parameters.

Return Types

A DATETIME timestamp.

Errors

now does not return errors.

See Also

datestring(), casting, curdate(), curdatetime(), curtime()