day like, day name? or day like the day number in a date?

The Javascript Date() object does not have a day "name" property, howev
er
you can get the day number and date number


today=new Date("some date");  //this syntax isn't correct but you get
 the
picture
indexedDay=today.getDay()     //will set indexed day to a zero base
d number
starting from sunday
indexedDate=today.getDate()   //will give you what day of the month
 it is
as an int

does that answer your ?




Ray Bujarski <[EMAIL PROTECTED]> on 02/21/2002 04:15:33 PM

Please respond to [EMAIL PROTECTED]

To:   CF-Talk <[EMAIL PROTECTED]>
cc:

Subject:  OT Javascript: Date Parsing


Does anyone know how to parse the day out of a given date in javascript
.

I want to do the equivalent of datepart(d, thisDate).

<form name="sessionWatch">
<cflock scope="SESSION" timeout="3" type="READONLY">
     <cfoutput><input type="hidden" name="seshTimeOut"
value="#session.timeout#"></cfoutput>
</cflock>
</form>

var ses=new Date();
var yrJS = ses.getYear("yyyy", document.sessionWatch.seshTimeOu
t.value);
var monJS = ses.getMonth("m", document.sessionWatch.seshTimeOut
value);
var dJS = ses.getDay("d", document.sessionWatch.seshTimeOut.v
alue);
var hJS = ses.getHour("h", document.sessionWatch.seshTimeOut.
value);
var nJS = ses.getMinutes("n", document.sessionWatch.seshTimeOut
value);
var sJS = ses.getSeconds("s", document.sessionWatch.seshTimeOut
value);

______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to