Re: Date fornat on Informix
Posted in 1998
On Sat, 20 Jun 1998 19:17:00 GMT, Wolfgang Beutner <wbeutner@csi.com>
wrote:
>Am 20.06.98, 20:32:00, schrieb "Albert Fern=E1ndez Marsal"=20
><alberfm@tinet.fut.es> zum Thema Date fornat on Informix:
>
>
>> I'm using Informix v 7.0 (in a unix platform), and it's default
>
>date
>> format is d/m/y (spanish format). i must insert some values from a file in
>> the m/d/y format.
>>
>> anyone knows how to change the default date format for Informix?!?=
>
>>
>You should set the shell-variable DBDATE in the environment of user
>informix to the desired format before you start the server.
There is absolutely no need to do this. May be you get the format you
set here as the default format for the engine (I haven't ever tried
that), but even if you do it's very unlikely you want that.
Just set it in the environement of the user who does the loading and
only for the duration of the load. (You need to set it back to
whatever you had before to get your applications to work correctly.)
> See the
>documentation for the applicable formts. I think for you it should be
>
>DBDATE=3DDMDDYY; export DBDATE.
DBDATE=MDY4/export DBDATE
or something like that. The 4 and / are usually not very important for
importing. If you have 2 digits for the years (4 will still work in
the format string but you can then use 2 as well) you will of course
eventually get a year 2000 problem which can either be solved by
making sure you have 4 digits for the year (the best solution) or
using the DBCENTURY environement variable. For DBCENTURY you do
however need a newer version than 7.0x.
After the import you set it back to:
DBDATE=DMY4/export DBDATE
assuming you use 4 digits for the years in your applications. If you
don't you have to start doing it immediately. Using DBCENTURY is an
alternative, but not a good one. Of course DBCENTURY is still
interesting to enable users to type in 2 digit years and get them
correctly displayed in fields with 4 digits for the year.
Nils Myklebust
NM Data AS
Norway
E-mail: Nils.Myklebust@nmdata.com
FAQ at: http://www.iiug.org/techinfo/faq/faq_top.html
(Now with ODBC info under "Third party products".)