Path: utzoo!attcan!uunet!cs.utexas.edu!ntvaxb!mouse From: mouse@vaxb.acs.unt.edu (Dhanapong Saengrussamee, University of North Texas) Newsgroups: comp.sys.ibm.pc Subject: Re: I need a date :) please help Message-ID: <23446.261e0937@vaxb.acs.unt.edu> Date: 7 Apr 90 15:37:27 GMT References: <19500060@uxh.cso.uiuc.edu> Lines: 30 In article <19500060@uxh.cso.uiuc.edu>, mead@uxh.cso.uiuc.edu writes: > QUERY: Does anyone know of *any* source for an intelligent algorythm > for getting the day ('Monday, Tuesday, ...') from the date (4/3/90). > My PC does it like lightning each time I issue the 'DATE' command, and > if IBM can do it, anyone can - right? :) Textbooks or whatever are > fine, but please don't direct me to existing software unless it's PD > source code (in BASIC, C, Pascal, or FORTRAN). Thanks. > > -alan mead : mead@uxh.cso.uiuc.edu I assume that the program you try to write is for PC, right? DOS interrupt $21 function $2A is what you need. Call with AH = $2A Return: CX = year (1980 through 2099--don't know what will happen after the year 2099 8^)) DH = month (1 through 12) DL = day (1 through 31) AL = day of week (0 = Sunday, 1 = Monday) Hope this help, Mouse .o()~ -----------------------------------+------------------------------------------ Dhanapong "Mouse" Saengrussamee | AppleLink : U1364 | BITNET : mouse@untvax Technical Support, CECS Dept., | BIX : d.mouse.s | CompuServe : 71301,1516 University of North Texas, | GENie : d.saengrussa | IP : 129.120.1.4 PO Box 5155, Denton, TX 76203-5155 | Internet : mouse@vaxb.acs.unt.edu voice (871) 565-4379 | SPAN : utspan::utandx::ntvaxb::mouse fax (817) 565-4425 | THENet : ntvaxb::mouse ------------------- UUCP : {...!uunet!convex!iex}!ntvax!vaxb.acs.unt.edu!mouse