Get the value from the following FoxPro Assignment Statement

Please tell me what is the value of the following assignment statement
M.mmy = left(dtoc(date()),2) + substr('ABCDEFGHJKLMNPQRSTUVWXYZ', (year(date()) - 1987) % 24 + 1, 1)

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shows a two character reference to the month of the specified date, followed by a letter representing a rotation starting in 1987.  ie, April this year is 04Z, April next year is 04A, April the year after is 04B.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Result of above expression depends on  SET DATE and SET CENTURY setting, so the result string could begin with two digits representing:

1) Month  when SET DATE is American, USA, MDY
2) Day  when SET DATE is German, British, DMY, Italian,
3) Year when SET DATE is Japan, Taiwam , YMD, ANSI and SET CENTURY is OFF
4) Century+1 when SET DATE is Japan, Taiwam , YMD, ANSI and SET CENTURY is ON

The rest is correct.
Of course, the last option is Century - 1

When SET DATE is SHORT or LONG then the result depends on Windows settings...
tgatif2000Author Commented:
(year(date()) - 1987) % 24: Can you explain how do you get 23?
Wouldn|t it be better to execute FoxPro and try following commands in Command window?

?  DATE()
?  YEAR(DATE()) - 1987
?  (YEAR(DATE()) - 1987) % 24
?  (YEAR(DATE()) - 1987 + 1) % 24
?  (YEAR(DATE()) - 1987 - 1) % 24
?  (YEAR(DATE()) - 1987 + 2) % 24
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.