AV1611 Posted March 10, 2006 Share Posted March 10, 2006 n/m:[code]var Today = new Date()Today.setDate(-365)[/code]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..[code]var Today = new Date();[/code]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 :( Quote Link to comment https://forums.phpfreaks.com/topic/4624-more-of-a-js-question/ Share on other sites More sharing options...
lessthanthree Posted March 10, 2006 Share Posted March 10, 2006 [code]var myDate = new Date;myDate.setDate(myDate.getDate()-265);[/code]should do it Quote Link to comment https://forums.phpfreaks.com/topic/4624-more-of-a-js-question/#findComment-16198 Share on other sites More sharing options...
AV1611 Posted March 11, 2006 Author Share Posted March 11, 2006 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... Quote Link to comment https://forums.phpfreaks.com/topic/4624-more-of-a-js-question/#findComment-16333 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.