[comp.sys.mac.hypercard] date

mm@blake.acs.washington.edu (Eric Gorr) (04/30/89)

Hello, I was wonding if anyone had a script, XMCD, etc.. that if I were to
tell it (format doesn't matter) 4/27/89 it would tell me that it was a 
thursday.
 
Thanx.....  :=))
 

stone@hydra.unm.edu (Andrew Stone CS.DEPT) (04/30/89)

In article <1814@blake.acs.washington.edu> mm@blake.acs.washington.edu (Eric Gorr) writes:
>Hello, I was wonding if anyone had a script, XMCD, etc.. that if I were to
>tell it (format doesn't matter) 4/27/89 it would tell me that it was a 
>thursday.

Try this:

function getDayOfWeek myDate
  convert myDate to long date
  return first item of myDate
end getDayOfWeek

example: put getDayOfWeek(2/12/56)
returns: Sunday

andrew

||<<++>>||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>||
!!	   Andrew Stone	            !!        the fictive milieu of	!!
!!         stone@hydra.unm.edu	    <> 	      contemporary society!	!!
||<<++>>||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>||

englandr@phoenix.Princeton.EDU (Scott Englander) (05/01/89)

I think there is an example in the Help stack -- see "date" there.

-- 

                                               - Scott

aisl@uhura.cc.rochester.edu (Lawrence Landry) (05/02/89)

In article <1814@blake.acs.washington.edu> mm@blake.acs.washington.edu (Eric Gorr) writes:
>Hello, I was wonding if anyone had a script, XMCD, etc.. that if I were to
>tell it (format doesn't matter) 4/27/89 it would tell me that it was a 
>thursday.

function weekDay theDate
   convert theDate to dateItems
   put item 7 of theDate into dayNumber
   put "Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday" into wk
   return item dayNumber of wk
end weekDay

Larry Landry
University of Rochester