ComputerForum.com ComputerForum.com  
TigerDirect
 
Go Back   Computer Forum > Computer Software > General Software

Reply
 
LinkBack Thread Tools Display Modes
Old 04-01-2005, 11:25 PM   #1 (permalink)
Moderator
 
Cromewell's Avatar
 
Join Date: Dec 2004
Location: Canada
Age: 25
Posts: 10,115
Default MySQL Question

I'm trying to get my timestamp(14) field to default populate to now and what ever function I use that is supposed to retrun the current time always returns the end of time (18th Jan 2038, 10:14:07 PM). Does anyone know what I'm doing wrong? (I'm sure it's something stupid but I can't track it down)
__________________

You know what the chain of command is? It's the chain I go get and beat you with 'til ya understand who's in ruttin' command here.

I must plug a couple comics because they are good :D:
www.ctrlaltdel-online.com
www.userfriendly.org
Cromewell is offline   Reply With Quote


Old 04-01-2005, 11:38 PM   #2 (permalink)
VIP Member
 
mgoldb2's Avatar
 
Join Date: Nov 2004
Age: 25
Posts: 1,259
Default

did you try using the NOW() function.
__________________
Acer A11912B 19"montior
Aspire x-superalien case
Asus k8t800 pro motherboard
athlon 64 fx-55
2GB(2 of 1GB) of Geil DDR ram
Geforce 6800 ultra
2 Seagate 200GB 7200RPM Model ST3200822A configure as RAID 0
1 DVDRW and 1 CDRW
3.5 drive
sound blaster audigey2 zs
logitech 2300 thx certified 2.1 speakers
mgoldb2 is offline   Reply With Quote
Old 04-01-2005, 11:49 PM   #3 (permalink)
VIP Member
 
Chroder's Avatar
 
Join Date: Dec 2003
Location: Toronto, Ontario
Age: 19
Posts: 1,302
Default

Yes, NOW(), UNIX_TIMESTAMP(), DATE() etc. will all return the current date (see more from date and time functions).

Note that if you simply leave that field out when you are inserting or updating, mySQL will automatically populate the field with the current date and time from the server.
__________________
:: Devlog - New developer blog with useful PHP information
::
The New Tech - Technology Forum
:: WeTalk.tv - TV Forums
Chroder is offline   Reply With Quote
Old 04-02-2005, 12:13 AM   #4 (permalink)
Moderator
 
Cromewell's Avatar
 
Join Date: Dec 2004
Location: Canada
Age: 25
Posts: 10,115
Default

yes I tried NOW(), NOW()+0, UNIX_TIMESTAMP() all gave me the date I posted

edit:even leaving blank results in 20050401191855 being returned
__________________

You know what the chain of command is? It's the chain I go get and beat you with 'til ya understand who's in ruttin' command here.

I must plug a couple comics because they are good :D:
www.ctrlaltdel-online.com
www.userfriendly.org

Last edited by Cromewell; 04-02-2005 at 12:22 AM.
Cromewell is offline   Reply With Quote
Old 04-02-2005, 02:12 AM   #5 (permalink)
VIP Member
 
Chroder's Avatar
 
Join Date: Dec 2003
Location: Toronto, Ontario
Age: 19
Posts: 1,302
Default

Then somehow your system time is wrong, or mySQL doesn't like your system time

What happens if you simply do
Code:
SELECT NOW()
The same output, I presume?
__________________
:: Devlog - New developer blog with useful PHP information
::
The New Tech - Technology Forum
:: WeTalk.tv - TV Forums
Chroder is offline   Reply With Quote


Old 04-02-2005, 02:14 AM   #6 (permalink)
Moderator
 
Cromewell's Avatar
 
Join Date: Dec 2004
Location: Canada
Age: 25
Posts: 10,115
Default

Nope that works fine...
Quote:
+---------------------+
| NOW() |
+---------------------+
| 2005-04-01 21:13:59 |
+---------------------+
__________________

You know what the chain of command is? It's the chain I go get and beat you with 'til ya understand who's in ruttin' command here.

I must plug a couple comics because they are good :D:
www.ctrlaltdel-online.com
www.userfriendly.org
Cromewell is offline   Reply With Quote
Old 04-02-2005, 02:18 AM   #7 (permalink)
VIP Member
 
Chroder's Avatar
 
Join Date: Dec 2003
Location: Toronto, Ontario
Age: 19
Posts: 1,302
Default

Well that doesn't add up...
__________________
:: Devlog - New developer blog with useful PHP information
::
The New Tech - Technology Forum
:: WeTalk.tv - TV Forums
Chroder is offline   Reply With Quote
Old 04-02-2005, 02:30 AM   #8 (permalink)
Moderator
 
Cromewell's Avatar
 
Join Date: Dec 2004
Location: Canada
Age: 25
Posts: 10,115
Default

no it doesn't, somethings fuggered up good and I'm just going to work around it now but if anyone comes up with something then by all means tell me
__________________

You know what the chain of command is? It's the chain I go get and beat you with 'til ya understand who's in ruttin' command here.

I must plug a couple comics because they are good :D:
www.ctrlaltdel-online.com
www.userfriendly.org
Cromewell is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:58 AM.


Powered by: vBulletin Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Copyright © 2002-2007 Computer Forum and Web Design Forum