Convert String to Date - Localizations Issue

DBohner-(db)

Legendary Poster
Howdy,

Recently I was asked to debug an issue with Date Localization...

When a user runs a report that uses the function N08000640 (Convert String to Date) and has their date format set to <blank> (according to application P0092) - the report displays the date correctly.
For Example:
User's P0092 Fromat: <blank> (default)
Using: N0800640
Passing in: 01022006 (mmddccyy)
Getting Back: 1/2/2006 (MM/DD/CCYY)
This works GREAT

However - if I change the date format for the user in the P0092 screen it get's 'sad'.
For Example:
User's P0092 Fromat: DMY (european)
Using: N0800640
Passing in: 01022006 (mmddccyy)
Getting Back: 2/1/1920 (DD/MM/CCYY)
This stinks - NOTE - the 1920...

And WORSE - if I passing something with a day greater than 12 (say we are working on January thirteen 2006 (01132006) - it doesn't pass any date back...

For Example:
User's P0092 Fromat: DMY (european)
Using: N08000640
Passing in: 01132006 (mmddccyy)
Getting Back: (DD/MM/CCYY)

I created a routine to remap the string date to be the same as the user's defined format - then run the convert string to date NER... Now all my dates return - but I still get the 1920 years on all returend dates.

For Example:
User's P0092 Fromat: DMY (european)
Using: N08000640
Passing in: 13012006 (mmddccyy)
Getting Back: 13/01/1920 (DD/MM/CCYY)

Short of calling bOrgacle - any of you know what is going on? Is there setup someplace that needed to be acquired?

(db)
 
Hi,

Is the BSFN crashing on a local report or on a server one?

If it's crashing on the server, I suspect that user
date format (P0092) is different than the OS date format
on the server.

Run R0008P on the server and you'll get an idea of
what date format it's actually using.

Regards,
 
Sebastian,

It's not crashing, technically - it is not providing the correct results (anywhere) of any date format is specified in the P0092 screen.

when run locally and the P0092 is set for DMY - I'm getting bad Years

I've narrowed the object down to B0800208.c as the culprit.
when that function gets passed a date (say 06/02/2006) and localization is on - it passes me back 'nYear-1920 nMonth=2 nDay=6... the month and date that are returned are correct, however - where the heck did it come up with that Year?

Apparently N080064 is not formatting the date (year part) correctly - thus, B0800208 is taking the first to characters of the year.

Anyone know where the date formats are kept?

now, I'm off to go play with the kg.

(db)
 
In a nutshell, here's what's happening:

we pass in a string date to the N0800640 function (01122006).
the function then pulls the date format from the F00921 file
the function then pulls the 'real' date format, using B0800208 - returning ASOSR (two char day, Slash, two char month, slash, two character year)
the N0800640 then re-builds the passed in Date String (01/12/2006)
the newly formatted date string gets pased to the B0800208 again - this time with the ASOSR formatting and the formatted date.

Issue - if you haven't caught it already - 'R' is a two character year and we just passed it 2006... I'm getting 1920 passed back because the R in the date formatting is causing the first two characters of the year to be picked up...

ok - anyone know where I change the date formatting at? Is it an OK thing to do? Now that I've seen this - I want to validate against someone else's setup - but, I don't knnow where to find that crazy Date Mask.

suggestions?

(db)
 
Back
Top