Re: Newbie question - current date - time
| From: | Daniel Brown | Date: | Wed, 14 Nov 2007 20:39:51 +0000 |
| Subject: | Re: Newbie question - current date - time | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-264522@lists.php.net to get a copy of this message | ||
On Nov 14, 2007 3:19 PM, Jon Westcot <jon@westcot.net> 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....
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.