How to change date to a pretty date - UV

92 views
Skip to first unread message

Dawn Wolthuis

unread,
Dec 14, 2021, 12:21:52 PM12/14/21
to mvd...@googlegroups.com
We have a date on a document of 12/12/2021 and would like that to be written as

December 12 2021
or
December 12, 2021

Is there some variation on OCONVs that can get us there or does anyone have a subr? I have a time crunch, so I thought I would ask, just in case someone knows right off.

Thanks in advance.  --Dawn

Martin Phillips

unread,
Dec 14, 2021, 12:25:37 PM12/14/21
to mvd...@googlegroups.com

Dawn,

 

Conversion code D4DMAYL should do the job if your MV system supports it.

 

 

Martin

 

From: mvd...@googlegroups.com <mvd...@googlegroups.com> On Behalf Of Dawn Wolthuis
Sent: 14 December 2021 17:22
To: mvd...@googlegroups.com
Subject: [mvdbms] How to change date to a pretty date - UV

 

EXTERNAL EMAIL




--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mvdbms/CANKEuc6Sv_xK%3DdxzRHKrAy%3DXgEJA2k7%3D2%3DNqo1xVoBAq4w0_cw%40mail.gmail.com.

================================
Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 02451 ■ Main Office Toll Free Number: +1 855.577.4323
Contact Customer Support: https://my.rocketsoftware.com/RocketCommunity/RCEmailSupport
Unsubscribe from Marketing Messages/Manage Your Subscription Preferences - http://www.rocketsoftware.com/manage-your-email-preferences
Privacy Policy - http://www.rocketsoftware.com/company/legal/privacy-policy
================================

This communication and any attachments may contain confidential information of Rocket Software, Inc. All unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify Rocket Software immediately and destroy all copies of this communication. Thank you.

Steve Trimble

unread,
Dec 14, 2021, 1:03:15 PM12/14/21
to mvd...@googlegroups.com
Dawn, if your date is in OCONV(XXX,"D4/") format, do this:
VAR$ = YOUR.DATE
VAR$ = ICONV(VAR$,"D") ; * convert to internal format
MONTH.NAME = OCONV(VAR$,"DMA") ; * alphabetic month
MONTH.DAY  = OCONV(VAR$,"DD") ; * numeric day of month
MONTH.YEAR = OCONV(VAR$,"DY") ; * numeric year of month
CRT \cur.date \:OCONV(MONTH.NAME,"MCT"):" ":MONTH.DAY:", ":MONTH.YEAR

use the 'MCT' to Upper/Lower case the month name, so the result is:

cur.date December 14, 2021

have fun!


Computerized Data Mgmt Inc
Steve Trimble
(501) 772-3450 cell / text


--

Dawn Wolthuis

unread,
Dec 14, 2021, 2:10:29 PM12/14/21
to mvd...@googlegroups.com
Thanks Martin and Steve!

I got almost all the way there with  a variation of Martin's -- D4MADYL but don't know how/if the comma can get in there.

I'm helping a customer, and in this case, while I could create a virtual field with a subroutine, that would be in another category (requiring deployment of new metadata when I can put an OCONV into our xsl docs on the front-end without a "customization/$")

So, almost there, sans comma, and one of  either Martin's 

12 December 2021

or the alternative
December 12 2021

might be OK for the customer. If anyone knows how to get that comma in there with the OCONV sans subroutine, I would be interested. Aside from that THANKS A BUNCH!  --Dawn



Martin Phillips

unread,
Dec 15, 2021, 5:05:02 AM12/15/21
to mvd...@googlegroups.com

Hi Dawn,

 

If you want the comma, try

   D4MADYL[,”, ”]

Noting that the string in double quotes is comma space.

 

Martin

 

From: mvd...@googlegroups.com <mvd...@googlegroups.com> On Behalf Of Dawn Wolthuis
Sent: 14 December 2021 19:10
To: mvd...@googlegroups.com
Subject: Re: [mvdbms] How to change date to a pretty date - UV

 

EXTERNAL EMAIL




Thanks Martin and Steve!

 

I got almost all the way there with  a variation of Martin's -- D4MADYL but don't know how/if the comma can get in there.

 

I'm helping a customer, and in this case, while I could create a virtual field with a subroutine, that would be in another category (requiring deployment of new metadata when I can put an OCONV into our xsl docs on the front-end without a "customization/$")

 

So, almost there, sans comma, and one of  either Martin's 

 

12 December 2021

 

or the alternative

December 12 2021

 

might be OK for the customer. If anyone knows how to get that comma in there with the OCONV sans subroutine, I would be interested. Aside from that THANKS A BUNCH!  --Dawn

 

 

 

On Tue, Dec 14, 2021 at 1:03 PM Steve Trimble <cdm...@gmail.com> wrote:

Dawn, if your date is in OCONV(XXX,"D4/") format, do this:

VAR$ = YOUR.DATE

VAR$ = ICONV(VAR$,"D") ; * convert to internal format
MONTH.NAME = OCONV(VAR$,"DMA") ; * alphabetic month
MONTH.DAY  = OCONV(VAR$,"DD") ; * numeric day of month
MONTH.YEAR = OCONV(VAR$,"DY") ; * numeric year of month

CRT /cur.date \:OCONV(MONTH.NAME,"MCT"):" ":MONTH.DAY:", ":MONTH.YEAR

Dawn Wolthuis

unread,
Dec 15, 2021, 6:14:23 PM12/15/21
to mvd...@googlegroups.com
Perfect! Thanks so much.  —Dawn

Sent from my iPad

On Dec 15, 2021, at 4:05 AM, Martin Phillips <mphi...@rocketsoftware.com> wrote:



philippe GRACIA

unread,
Dec 16, 2021, 11:23:37 AM12/16/21
to Pick and MultiValue Databases
Hello !
we made a little sub ton convert date to sting,  like windev ( a french IDE).
here it is, free to modify :)

in your case, it will be call datetostring(your.date,"MMMM DD, YYYY",your.string)

subroutine datetostring( d, fmt, ret)
jj="0":oconv(d,"dd")                    
jj=jj[len(jj)-1,2]                      
mm=oconv(d,"dm")                        
if len(mm)=1 then mm="0":mm            
 mm=mm[len(mm-1),2]                    
mmmm=oconv(d,"dma")                    
jjjj=oconv(d,"dwa"):" ":jj              
aaaa=oconv(d,"dy")                      
aa=aaaa[3,2]                            
if fmt="" then fmt="JJ/MM/AAAA"   ; * french format     
ret=swap(fmt,"AAAA",aaaa)              
ret=swap(ret,"AA",aa)                  
ret=swap(ret,"MMMM",mmmm)              
ret=swap(ret,"MM",mm)                  
ret=swap(ret,"jjjj",jjjj)              
ret=swap(ret,"JJ",jj)                  
return                                 

Scott Ballinger

unread,
Dec 16, 2021, 2:13:51 PM12/16/21
to Pick and MultiValue Databases
Hi Dawn,

In D3 it is just "df", e.g. oconv(date(),"df")

/Scott Ballinger

Reply all
Reply to author
Forward
0 new messages