With a couple of corrections, yes, it did work.
PRINT OCONV("16507","D-YMD[2,2,2]":@VM:"MCN")
This returned the value 130311.
You were missing the last 2 and the year is 2013, not 2012. This was a
good thought, though. Cool!!!!
-----Original Message-----
From: Charles Stevenson [mailto:[email protected]]
Sent: Monday, March 11, 2013 10:59 AM
To: U2 Users List
Cc: Woodward, Bob
Subject: Re: [U2] ISO Date Format
Bob,
I'm curious,on UD6.1 does this work, using 2 conversion codes with a
value mark between? :
OCONV( "16507", "D-YMD[2,2,]": @VM: "MCN" ) --> "120311"
cds
On 3/11/2013 12:16 PM, Woodward, Bob wrote:
> I guess you need to be on a more current version of UD than 6.1 for
> this to work. DYMD[4,2,2] works just fine but everything I've tried
> is proving that in this version, anyway, there MUST be a delimiter
> between the parts of the date. It does not matter what delimiter as
> I've tried space, period, slash, even a comma but for both ICONV and
> OCONV adding a quote of any type, null/space/dash/etc, to the numeric
> only gives undesired results.
>
> I have to strip out the delimiter in OCONV results and make sure some
> kind of delimiter is there for ICONV to get me back to the internal
> date value.
>
> An interesting note is using the OCONV(IDATE,'D-YMD[2,2,2]') format,
> the dash can be replaced with the digits 5 to 9 but using the digits 0
> to 4 result in an output delimited with a space. Would have been
> acceptable (and nice) to have been able to get 13003011 but oh well.
> I guess I could use 'D5YMD[2,2,2]' to give me the value 13503511 just
as well.
>
> Fun with dates!
>
> BobW
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Charles
> Stevenson
> Sent: Monday, March 11, 2013 8:08 AM
> To: U2 Users List
> Subject: Re: [U2] ISO Date Format
>
> By the way, you can also completely eliminate the dash (or slash,
> etc.)
> delimiters:
>
> OCONV( "16507" , "DYMD[4'',2'',2]" ) --> "20130311"
> ICONV( "20130311", "DYMD[4'',2'',2]" ) --> "16507"
>
> Notice that ICONV'ing the OCONV'd or OCONV'ing the ICONVd result gets
> you bat to where you started. That makes it particularly useful in
> dict conversion fields.
>
>
> I learned that on this list, but I do not remember from whom. There
> are too many people I've learned from.
>
> cds
>
>
> On 11 March 2013 13:56, Jeff Schasny <[email protected]> wrote:
>>> Has anyone come up with an OCONV string that will product an ISO
>>> standard date (YYYY-MM-DD)? After a vendor insisted on this last
>>> week I ended up creating a subroutine called by an I descriptor but
>>> it seems like there should be an easier way. A quick trip through
>>> the Universe Basic manual, my old Prime Info-Basic manual, and Pick
>>> Basic: A programmer's guide didn't shed any light.
>
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users