i want to add document.getElementById with this script <html> <head> <script src="date.format.js"></script> <script> function nextDateFromDateString(text) { var regex = /(\d+)\/(\d+)\/(\d+)(.*)/; var date = new Date(text.replace(regex, '$2/$1/$3$4')); date = new Date(date.valueOf() + 86400000); return date.format("mm/dd/yy HH:MM:ss"); } var date = "29/06/2008 09:00:00"; date = nextDateFromDateString(date); </script> </head> <body><table> <tr> <td id="judge">29/06/2008 09:00:00</td> <td>..</td> <td>..</td> <td>..</td> </tr> </table></body> </html> Code (markup): here's the external file source code
Add it where? To do what? Try being more specific. It's like you go to the car dealer and say 'I want a car'
the main goal:i want to add +1 to day mean the day appear as 30 rather than 29 and i try to used this code to solve my problem problem : i want to use document.getElementById i but i didn't know. mean that i want to add this in first <td> which have id=judge to add 1+ for any day appear in this cell if u have any idea beyond the scope this script plz share
yeah adding + 1 day w/o a proper calendar function is not a good plan. how would you know if its 28,29,30 or 31 days before you turn over into month+1? there are plenty of js calendar scripts and classes around that can do this, just google. sometimes, it does not pay off to invent the wheel imo.
let me explain this data express oneself about start contract data to my client , when i insert the date in my databse stored -1 mean if creat contract in 28 will stored 27 in database and so on ....... i want script make the data as it were mean retraive the contract data to 28
so, then - change your mysql statement to something like: set contract_date = DATE_ADD(NOW(), INTERVAL -1 DAY) problem solved, you don't need to trust js and client machines and so forth.