Re: Newbie question - current date - time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Nov 14, 2007, at 3:39 PM, Daniel Brown wrote:

On Nov 14, 2007 3:19 PM, Jon Westcot <jon@xxxxxxxxxxx> wrote:
Hi:

Hi Folks,

Newbie question :

- how do I get and display the current date?
- how do I get and display the current time?

I see the getdate function - but I'm not sure if this is the right
function
or how to display it....

http://www.php.net/manual/en/function.getdate.php

Give this a shot:

$Date = date("y/m/d h:m:i");
echo $Date;

You can format it how ever you want. Lots of different options. Check
out: HTTP://www.php.net/date for lots more info.

Um, not to pick nits, and being a newbie myself I'm really risking a lot here by potentially exposing my ignorance, but was the purpose of the code above to get the user to read the manual section? It sure worked for me when I saw the output of the date command and couldn't believe that the process I was running completed in just six seconds. It all boiled down to changing (dare I say correcting?) "h:m:i" to "h:i:s" -- the "m" in question
related to the month in the date, not minutes in the time.

And thanks to everyone for being so willing to help and generous with
their time.  I really appreciate it!

   Jon

   Ha!  No, it was just a typo on Jason's part.

   Funny stuff though....

Now... Just exactly what makes you think it was a typo oh Master Brown? I could have intentionally put that in there just as Jon suggested to get the OP to read the web page since it wouldn't output what they expected. I have been known to be crafty like that in the past :)

In this particular case it was a simple matter of a quick typing in an e-mail program and a faulty memory I would claim a "Senior Moment" but I dare say that most everyone on this list is older then me. Being born in raised in the decade of the "Hair Bands" and all :)

(Is it time to go home yet?)

--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
japruim@xxxxxxxxxx

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux