Calendar script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
alix
Forum Commoner
Posts: 42
Joined: Thu Nov 18, 2004 8:41 am

Calendar script

Post by alix »

Im using a snipplet that i found here, Click here Its a script from this forum. It works, but what would i have to change to get it to display the month and day with two digits, IE. "01" instead of "1" or "09 instead of "9" .. etc.

My goal is to get "2006-03-13" in the text box instead of "3/13/2006"

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

concentrate on all calls to date()
alix
Forum Commoner
Posts: 42
Joined: Thu Nov 18, 2004 8:41 am

Post by alix »

I did, and when it appears to be, for instance, calling the day of the month, its using the "d" which is for the 2 digit number for the day of the month for the date() function.. this is why im lost... then again, sometimes i believe my mind is constantly lost... who knows. lol
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

there are several using n and j
alix
Forum Commoner
Posts: 42
Joined: Thu Nov 18, 2004 8:41 am

Post by alix »

I think it has something to do with this function strtotime(). I just read up on it... Apparently it doesnt spit out both digits on the older versions of PHP.. wont really work for MySQL datetime strings, which is what im working for.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

strtotime() returns a unix timestamp, not a formated string.
Post Reply