Date with time (local zone)

From: Timothy Hansen 

> Next question is, does anyone know of an alternative function that is local
> time zone specific yet returns a date (and time) in fixed output format which
> code can reliably do things with?
> 
> The documentation mentions ISO date formats, but I get the impression this is
> needs to be configured for the database like anything else.
> 
> Robert
> cowhamr@logica.com
> Opinions are my own

Whenever you convert a date to a character format, Ingres will use the
II_DATE_FORMAT setting to determine the format of the output. Use
ingprenv to see what it's set to. If it's not in your environment then
it defaults to US and dates will look like 'dd-mmm-yyyy'.

A date that is stored without a time can easily be converted to one with
a time by adding date('0 seconds') to it.

So to finally answer your question, use the text() conversion function
on your date field with 0 seconds added (or assign it to a char(25)
variable) and you'll have the date and time in the format
'dd-mmm-yyyy hh:mm:ss'
Ingres Q & A
To William's Home Page

© William Yuan 2000

Email William