11.14 'NOW'

Available inDSQL, PSQL, ESQL

TypeCHAR(3)

'NOW' is not a variable, but a string literal or datetime mnemonic. It is, however, special in the sense that when you CAST() it to a date/time type, you will get the current date and/or time. Since Firebird 2.0 the precision is 3 decimals, i.e. milliseconds. 'NOW' is case-insensitive, and the engine ignores leading or trailing spaces when casting.

Note

Examples

  1. select 'Now' from rdb$database
  2. -- returns 'Now'
  3. select cast('Now' as date) from rdb$database
  4. -- returns e.g. 2008-08-13
  5. select cast('now' as time) from rdb$database
  6. -- returns e.g. 14:20:19.6170
  7. select cast('NOW' as timestamp) from rdb$database
  8. -- returns e.g. 2008-08-13 14:20:19.6170