mysty Posted November 27, 2007 Share Posted November 27, 2007 I used to have (but lost) a small program for date and time format help. Once started, you could input date and time info and it would show the codes needed. It also had a choice between PHP or MySQL as the output code. Anybody know what this is or where I can find it? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 27, 2007 Share Posted November 27, 2007 that is pretty generic statement, you can use the date() function and it works just fine Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 28, 2007 Share Posted November 28, 2007 if you can do it together with your sql statement i'd suggest use sql.. Quote Link to comment Share on other sites More sharing options...
mysty Posted November 28, 2007 Author Share Posted November 28, 2007 I may not have explained this very well. Instead of looking up what specifiers to put for dates, this small program did it for you. It didn't put it into the PHP code. For that, you just copied the output into your own code. For example if I wanted a date output to say Nov 11, 2007 , I would need to put in my code %b %d, %Y. So, this little stand alone program would have blanks for you to fill out for Month, Day, Year and you would put Nov in Month, 11 for Day, and 2007 for Year and it would show you %b %d %Y. I think it even had a place to put dashes or slashes (ie: 11-11-07 or 11/11/07) and it would show you all the specifiers you need to use. Quote Link to comment Share on other sites More sharing options...
mysty Posted November 28, 2007 Author Share Posted November 28, 2007 Forgot to add that this is a freeware-type program. Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted November 28, 2007 Share Posted November 28, 2007 Forgive the intrusion, since I don't know the name of the program you are looking for... Programs that do things for you that you should know are a crutch, and make you a lazy programmer. Go to php.net, and thoroughly educate yourself on the date() and mktime() functions. Branch out to strftime() and strtotime(). It isn't brain surgery. It's not really even hard. In most cases, even though behind the scenes you are using Unix timestamps, you never really see them (you have mktime() pass them to date() without even seeing it happen, for example). The bottomline is, too many novice programmers skip the extremely important step of learning time functions, and it comes in handy so many times, over and over again. Take the time to learn this short list of tools, and throw your crutches away... / end advice PHrEEEk Quote Link to comment 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.