Jump to content

Date format program


mysty

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.