Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dates
Message
From
05/03/2003 22:54:30
 
 
To
04/03/2003 17:47:51
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Dates
Miscellaneous
Thread ID:
00761251
Message ID:
00761942
Views:
30
I would start by creating a function like this:
function getDate (tcPattern as character, tcDate as character) as date

  * do some parameter error checking ...

  lnday   = at(tcpattern,[dd])  && position of day in pattern
  lnmonth = at(tcpattern,[mm])  && position of month in pattern
  lnyear  = at(tcpattern,[yy])  && position of year in pattern
  lnyearlen = iif([yyyy] $ tcpattern,4,2) && length of year in pattern

  return (ctod(substr(tcdate,lnmonth,2)+;
        "/"+substr(tcdate,lnday,2)+;
        "/"+substr(tcdate,lnyear,lnyearlen))

endfunc
This of course will only work if you know the pattern that is being applied. Now that we have entered a new century it is harder to determine year than it used to be cause what is: "01/02/03" ?

Have fun!
Carole Shaw
Fred Hutchinson Cancer Research Center

Eagles may soar, but weasels don't get sucked into jet engines.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform