Skip to Content

mvSQL Database Function - NOW()

Summary

Gets the current date and time without a time zone offset.

Note

See the Time Zones article for more information.

Syntax

NOW(<origin>)

Parameters

origin

The logical time zone. Supported values include:

  • LOCAL - Data provider local time. In the case of an RDBMS, typically the database server local time.
  • UTC - Coordinated Universal Time.

Optional. Defaults to LOCAL.

Returns

Returns a datetime.

The datetime data type stores a timestamp without a time zone offset.

If the data source has a Time Zone value configured, Vinyl will return the same value for both Now(LOCAL) and Now(UTC).

Examples

The following examples assume that the current date and time in UTC is 2024-08-01 21:00:34.873.

Local (Default)

NOW()

Returns 2024-08-01 17:00:34.873

Local

NOW(LOCAL)

Returns 2024-08-01 17:00:34.873

UTC

NOW(UTC)

Returns 2024-08-01 21:00:34.873