Jump to content


Photo

More of a JS question...


  • Please log in to reply
2 replies to this topic

#1 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 10 March 2006 - 06:43 PM

n/m:
var Today = new Date()
Today.setDate(-365)

I don't know JS... I have an idea of how to "tweek" this with PHP, but if someone gives me the JS answer, I'd rather have it..

var Today = new Date();

I need var Today to = Date() MINUS 265 days...

I know how to do it in PHP, but know know how to send it to the JS script, and I have know idea how to do it in native JS...

It's easy, but not for me :(

#2 lessthanthree

lessthanthree
  • Members
  • PipPipPip
  • Advanced Member
  • 85 posts
  • LocationUK

Posted 10 March 2006 - 07:49 PM

var myDate = new Date;
myDate.setDate(myDate.getDate()-265);

should do it
call me a safe bet, i'm betting i'm not

#3 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 11 March 2006 - 04:08 AM

Actually, I didn't really fix it... but now it's working...

I discovered the setYear()

It works better for what I did...

Thanks anyways...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users