alphalinux.org axp-software list (1999-2001)
 help / color / mirror / Atom feed
* MySQL and NOW()
@ 1999-12-08  2:43 Rich Payne
  1999-12-09  3:16 ` Jason Burrell
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Payne @ 1999-12-08  2:43 UTC (permalink / raw)


Is anybody using the NOW() function within MySQL for DATETIME fields? I've

run into something a little strange. If, at the mysql command line I enter

"select NOW();" mysql returns the current date and time. Howver if I embed

that in a query:

insert into table (insert_date) values (NOW());

I end up with very strange dates, usually something like:

0000-00-00 00:01:33

and the system time is set correctly.

Any ideas?

I could set all this manually, but the NOW() funtion seems so much easier!

Rich Payne

rpayne@alphalinux.org			www.alphalinux.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MySQL and NOW()
  1999-12-08  2:43 MySQL and NOW() Rich Payne
@ 1999-12-09  3:16 ` Jason Burrell
  1999-12-09  3:23   ` Rich Payne
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Burrell @ 1999-12-09  3:16 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1461 bytes --]

I have the same problem, but a DATE w/now() works.

The change log @ http://www.mysql.com/Manual_chapter/manual_News.html

notes several bug fixes w/date/time things

in 3.23.4: storing datetimes (like now()) in a time fld attempted to store

           the days

That sounds similar to the problem.

-Jason

-

====================================================================

 Jason Burrell    |      Friends don't let friends use Windows.

 jburrell@mac.edu |          F U cn rd dis U mst uz Unix 2.

====================================================================

        Know what I hate most?  Rhetorical questions.

                                  -- Henry N. Camp

====================================================================

On Tue, 7 Dec 1999, Rich Payne wrote:

> 

> Is anybody using the NOW() function within MySQL for DATETIME fields? I've

> run into something a little strange. If, at the mysql command line I enter

> "select NOW();" mysql returns the current date and time. Howver if I embed

> that in a query:

> 

> insert into table (insert_date) values (NOW());

> 

> I end up with very strange dates, usually something like:

> 0000-00-00 00:01:33

> 

> and the system time is set correctly.

> 

> Any ideas?

> 

> I could set all this manually, but the NOW() funtion seems so much easier!

> 

> Rich Payne

> rpayne@alphalinux.org			www.alphalinux.org

>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MySQL and NOW()
  1999-12-09  3:16 ` Jason Burrell
@ 1999-12-09  3:23   ` Rich Payne
  0 siblings, 0 replies; 3+ messages in thread
From: Rich Payne @ 1999-12-09  3:23 UTC (permalink / raw)


Hmmm..... I'm using the 3.22.27, the 'stable' version and I don't think

date works properly either, though TIMESTAMP does (??).

Maybe I'll try the newer version, at least having DATE work would be a

step in the right direction.

--rdp

On Wed, 8 Dec 1999, Jason Burrell wrote:

> I have the same problem, but a DATE w/now() works.

> 

> The change log @ http://www.mysql.com/Manual_chapter/manual_News.html

> notes several bug fixes w/date/time things

> 

> in 3.23.4: storing datetimes (like now()) in a time fld attempted to store

>            the days

> 

> That sounds similar to the problem.

> 

> -Jason

> 

> -

> ====================================================================

>  Jason Burrell    |      Friends don't let friends use Windows.

>  jburrell@mac.edu |          F U cn rd dis U mst uz Unix 2.

> ====================================================================

>         Know what I hate most?  Rhetorical questions.

>                                   -- Henry N. Camp

> ====================================================================

> 

> On Tue, 7 Dec 1999, Rich Payne wrote:

> 

> > 

> > Is anybody using the NOW() function within MySQL for DATETIME fields? I've

> > run into something a little strange. If, at the mysql command line I enter

> > "select NOW();" mysql returns the current date and time. Howver if I embed

> > that in a query:

> > 

> > insert into table (insert_date) values (NOW());

> > 

> > I end up with very strange dates, usually something like:

> > 0000-00-00 00:01:33

> > 

> > and the system time is set correctly.

> > 

> > Any ideas?

> > 

> > I could set all this manually, but the NOW() funtion seems so much easier!

> > 

> > Rich Payne

> > rpayne@alphalinux.org			www.alphalinux.org

> > 

> 

Rich Payne

rpayne@alphalinux.org			www.alphalinux.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-12-09  3:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-12-08  2:43 MySQL and NOW() Rich Payne
1999-12-09  3:16 ` Jason Burrell
1999-12-09  3:23   ` Rich Payne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox