List:General Discussion« Previous MessageNext Message »
From:Ed Carp Date:September 7 2001 2:20pm
Subject:Re: sysdate() query and note to Mysql admin
View as plain text  
ryan@stripped (ryan@stripped) writes:

> now,what statement do I use to put the sysdate into the column today?
> this is NOT working
> insert into datee values(select DAYOFMONTH(sysdate()));

Of course not. "insert into datee values (Now())" will, though. Just feed it
to mysql ... ;)

Here's the JavaScript euqivalent, if that helps:

                function GetTheDate()
                {
                        now = new Date;
                        ty = now.getYear();
                        if(ty < 1900)
                        {
                                ty = ty + 1900;
                        }
                        mo = now.getMonth();
                        mo = mo + 1;

return(ty+'-'+ShowZeroFilled(mo)+'-'+ShowZeroFilled(now.getD
ate())+'
'+ShowZeroFilled(now.getHours())+':'+ShowZeroFilled(now.getMinutes()));
                }
--
Ed Carp, N7EKG  -  erc@stripped  -  214/341-4420 -
http://www.pobox.com/~erc

Squished Mosquito, Inc.
Internet Applications Development
Escapade Server-Side Scripting Language Development Team
http://www.squishedmosquito.com
Pensacola - Dallas - Dresden - London

Thread
sysdate() query and note to Mysql adminryan7 Sep
  • ODP: sysdate() query and note to Mysql adminDaniel Łaś7 Sep
Re: sysdate() query and note to Mysql adminEd Carp7 Sep