If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Once again this date problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-11-07, 05:43
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
Red face 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
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer

Last edited by rahul_s80; 10-11-07 at 06:58.
Reply With Quote
  #2 (permalink)  
Old 10-11-07, 06:48
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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 06:51.
Reply With Quote
  #3 (permalink)  
Old 10-11-07, 06:56
rahul_s80 rahul_s80 is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 10-11-07, 07:39
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
Reply With Quote
  #5 (permalink)  
Old 10-11-07, 09:09
rahul_s80 rahul_s80 is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 10-12-07, 11:04
rahul_s80 rahul_s80 is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On