Pulling in current date and time?

Pulling in current date and time?

am 30.10.2007 16:45:31 von paul814

I would like to populate the date text box on my html form with the
current date and time. here is what I have now:

How could I update this to automatically display the date and time in
this editorialdate field? I want it to be formatted correctly for
mySql DATETIME field.



Daily Production Report / Editorial




Please enter report data and press the SUBMIT button


Date:





Re: Pulling in current date and time?

am 30.10.2007 17:18:31 von Good Man

paul814@excite.com wrote in news:1193759131.795457.106780
@v3g2000hsg.googlegroups.com:

> I would like to populate the date text box on my html form with the
> current date and time. here is what I have now:
>
> How could I update this to automatically display the date and time in
> this editorialdate field? I want it to be formatted correctly for
> mySql DATETIME field.
>
>
>
> Daily Production Report / Editorial
>
>
>
>


> Please enter report data and press the SUBMIT button
>

> Date:
>

>
>
>
>

You can start by reading a book, tutorial or the PHP online manual which
offers great assistance.

People of this newsgroup generously offer their time to assist people with
PHP problems.... they don't do your homework, projects, or anything else
that you personally need 'done'.

http://ca.php.net/manual/en/function.date.php

Re: Pulling in current date and time?

am 30.10.2007 19:13:29 von paul814

I can get the date to show up...thats not the issue.
to get the current date I do this:
putenv('TZ=America/New_York');
echo date("Y-m-d h:i:s", time());
?>
And the current date is displayed.

I want to get that current date in the value of my textbox named
editorialdate so that it is auto filled in on load of page.

If I try to surround this:

Date:







in value of the textbox be equal to what I can already display on the
page.


On Oct 30, 12:18 pm, Good Man wrote:
> paul...@excite.com wrote in news:1193759131.795457.106780
> @v3g2000hsg.googlegroups.com:
>
>
>
> > I would like to populate the date text box on my html form with the
> > current date and time. here is what I have now:
>
> > How could I update this to automatically display the date and time in
> > this editorialdate field? I want it to be formatted correctly for
> > mySql DATETIME field.
>
> >
> >
> > Daily Production Report / Editorial
> >
> >
> >
> >


> > Please enter report data and press the SUBMIT button
> >

> > Date:
> >

> >
>
> >
> >
>
> You can start by reading a book, tutorial or the PHP online manual which
> offers great assistance.
>
> People of this newsgroup generously offer their time to assist people with
> PHP problems.... they don't do your homework, projects, or anything else
> that you personally need 'done'.
>
> http://ca.php.net/manual/en/function.date.php

Re: Pulling in current date and time?

am 30.10.2007 20:01:42 von Good Man

paul814@excite.com wrote in
news:1193768009.481351.191930@o3g2000hsb.googlegroups.com:

- top posting fixed -

>> You can start by reading a book, tutorial or the PHP online manual
>> which offers great assistance.
>>
>> People of this newsgroup generously offer their time to assist people
>> with PHP problems.... they don't do your homework, projects, or
>> anything else that you personally need 'done'.
>>
>> http://ca.php.net/manual/en/function.date.php


> I can get the date to show up...thats not the issue.
> to get the current date I do this:
> > putenv('TZ=America/New_York');
> echo date("Y-m-d h:i:s", time());
> ?>
> And the current date is displayed.
>
> I want to get that current date in the value of my textbox named
> editorialdate so that it is auto filled in on load of page.
>
> If I try to surround this:
>
> Date:
>
>

>
>

>
> in > value of the textbox be equal to what I can already display on the
> page.

Are you familiar with how to echo/print PHP variables to HTML? You
should be.

putenv('TZ=America/New_York');
$theDate = date("Y-m-d h:i:s", time());
?>

.... then all your form stuff (OUTSIDE THE PHP!!)

.... with your input like:




.... you should do a PHP tutorial or something, it's hard to get more
basic than this.