[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

3681.0. "Convert_date - UK to US problem" by GIDDAY::BURT (Scythe my dandelions down, sport) Mon Dec 20 1993 00:14

Hello and greetings,

Customer running ALL-IN-1 V3.0 (British(ish))
Customer is tring to do a CONVERT_DATE from dd-mm-yyy format to mm/dd/yy.

He has found that when he uses the key 1, the conversion does not get 
performed - he is left with the original date format. (no errors tho)

What should he be doing here?

Thanks & regards,

Chele B
T.RTitleUserPersonal
Name
DateLines
3681.1AIMTEC::ZANIEWSKI_DWhy would CSC specialists need training?Mon Dec 20 1993 13:103
        If the source format is dd-mmm-yyyy use format key #8.  
        
        Dave Zaniewski
3681.2still a problemGIDDAY::BURTScythe my dandelions down, sportMon Dec 20 1993 23:4125
Hi Dave,

re <<< Note 3681.1 by AIMTEC::ZANIEWSKI_D 

>        If the source format is dd-mmm-yyyy use format key #8.  
Using format key #8 doesn't work.
 "Source date is in an incorrect format"  (ie not NBS)

I thought it might be possible to try using key #7, to convert to NBS, 
then key #8 to convert back out of NBS, would work, but it still leaves the 
date in dd/mm/yyyy format.

I suspect that the problem relates back to the fact that it is the British kit 
(well, partially).

The object is to get the date format from dd/mm/yyyy to mm/dd/yyyy.

Any other ideas?

Thanks & regards,

Chele B



3681.3Temporarily changing the profile ...IOSG::MAURICEI left my heart in AlcatrazTue Dec 21 1993 08:4017
    Here's one method that would work, but not be quick - so would be OK if
    used infrequently. Assuming the user's profile setting for date format
    starts at "2" which is UK format, the script below temporarily changes
    it to US format, and then restores it.
    
    get #gb = "25/12/93"
    date_convert #nbs, #gb, 7
    write change profil user=oa$user, date$format=1
    oa$ini_glob
    date_convert #us, #nbs, 8
    write change profil user=oa$user, date$format=2
    oa$ini_glob
    get oa$display = "Converted date = " #us
    
    Cheers
    
    Stuart
3681.4Alternatively...IOSG::MARCHANTI&#039;d sink therefore I swamTue Dec 21 1993 10:417
    If you want a quick 'n dirty method, how about:

    date_convert #nbs, #GB_time, 7
    get #US_time = #nbs:2:4 "/" #nbs:2:6 "/" #nbs:2:2

    Cheers,
        Paul.
3681.5GIDDAY::BURTScythe my dandelions down, sportTue Jan 04 1994 02:469
Hello and Greetings,

Thankyou very much  - the .3 method is what the customer decided upon using, 
and works to his satisfaction.

Is it likely that the date_convert will ever be a little friendlier to those 
of us in "forn parts"?

Chele