-----Original Message-----
From: Scott Brady [mailto:[EMAIL PROTECTED]
Sent: October 16, 2003 1:53 PM
To: CF-Talk
Subject: re: getting the day of week in a date


YAY! Thank you all very much!!


Gabriel

Original Message:
> From: Gabriel Robichaud <[EMAIL PROTECTED]>

> Anyone know why this code doesn't return the right day of week?
> <cfset firstDayOfcurrMonth =
> DayOfWeek(FirstDayOfMonth(createdate(url.currYear, url.currMonth,
> url.currday)))>

firstDayOfMonth() returns the actual number of the day in the year that the
first day of a month starts on.  For example, February 1st would return 32
(the 32nd day of the year).

I think what you want is:
<cfset firstDayOfcurrMonth = DayOfWeek(createdate(url.currYear,
url.currMonth, 1))>

(since no matter what month it is, the first day is ALWAYS a date of "1"  [
X/1/2003 ])

Scott

---------------------------
Scott Brady
http://www.scottbrady.net/ <http://www.scottbrady.net/>

  _____  


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to