HP3000-L Archives

June 2003, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"VANCE,JEFF (HP-Cupertino,ex1)" <[log in to unmask]>
Reply To:
VANCE,JEFF (HP-Cupertino,ex1)
Date:
Wed, 11 Jun 2003 14:58:40 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (37 lines)
Larry wrote:
> :input mmddyy;prompt = "enter a date (mmddyy format)
> :setvar yymmdd str('!mmddyy',5,2) + str('!mmddyy',1,4)

which is correct. If you wish to allow more flexibility
in how the user enters the date, i.e., mm/dd/[yy[yy] or
mm-dd-[yy[yy]] or m/d/[yy] etc. then this might help
(from my LF script on Jazz):

 # convert date from M-D-Y format to yyyymmdd format
 setvar _lf_dd rht("00"+word(_lf_date,"/-",2),2)
 setvar _lf_mm rht("00"+word(_lf_date,"/-"),2)
 if delimpos(_lf_date,"/-") = delimpos(_lf_date,"/-",-1) then
    # no year supplied
    setvar _lf_yyyy "!hpyyyy"
 else
    setvar _lf_yyyy word(_lf_date,"/-",-1)
    if len(_lf_yyyy) <> 4 then
       # prepend century
       if !_lf_yyyy <= hpsplityear then
          setvar _lf_yyyy decimal(![lft("!hpyyyy",2)]*100+&
                          !_lf_yyyy)
       else
          setvar _lf_yyyy decimal((![lft("!hpyyyy",2)]-1)*100+&
                          !_lf_yyyy)
       endif
    endif
 endif
 setvar _lf_date _lf_yyyy+_lf_mm+_lf_dd
 # _lf_date now has the full YYYYMMDD date.

HTH,
 Jeff Vance, vCSY

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2