Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433

    Red face Unanswered: Once again this date problem

    i have created a db using
    db2 create db sample on f:\ using codeset ibm-1252 territory gb

    now since my territory code is GB , i should get date's in territory code specific manner i.e.

    Territory Code - 044 UK
    Local Date Format - dd/mm/yyyy
    Local Time Format -JIS
    Default Output Date Format - LOC
    Input Date Formats - LOC, EUR, ISO

    so, now if i run
    db2 values char (current date) it should return as 11/10/2007 as default

    however, it returns as :
    10/11/2007

    i know that we can change the default behaviour using bind commands
    but i havnt used them yet on this db. so why this db date format is deviating than expected ????

    this is causing many date specific differences between test and live environments.
    db2 9.1.2
    windows 2003
    Last edited by rahul_s80; 10-11-07 at 07:58.
    Rahul Singh
    Certified DB2 9 DBA / Application Developer

  2. #2
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,
    are you sure 11/10/2007 (11 October) is correct? I thing there is 11.10.2007 isn't it=
    Try using CHAR(date_field,format) command.
    'Format' can be: ISO, USA, EUR, JIS, or LOCAL
    Hope this helps,
    Grofaty
    Last edited by grofaty; 10-11-07 at 07:51.

  3. #3
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    yes, i know i can use it, but my question is somewhat else

    why is the default behaviour not happening?
    the application is already developed and it behaves differently in many places (date cases) on live and test environment
    Rahul Singh
    Certified DB2 9 DBA / Application Developer

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,
    have you checked Windows Control Panel | Regional and Language Options?
    Check all of the setting in Regional and Language Option in production and test system. It looks like there is a problem in OS settings.
    Hope this helps,
    Grofaty

  5. #5
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    thanks ,
    though there was a difference in the regional settings, i corrected it , uninstalled db2..restarted server.. instaled it again, but still it is behaving like before on new db
    Rahul Singh
    Certified DB2 9 DBA / Application Developer

  6. #6
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    actually i changed the reginal setting but didn't set it as default.
    now after new settings as default its working as expected

    thanks again
    Rahul Singh
    Certified DB2 9 DBA / Application Developer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •