Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 29th, 2003, 12:25 PM
Neworld Neworld is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 2 Neworld User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 sec
Reputation Power: 0
Different problem with TIMESTAMP

In reality I have two problems.

Problem one:
I had this table on my database with a VARCHAR field called data. I' ve switched the type of the field to MYSQL TIMESTAMP and I dont know if the data is ok...

For example what once has 1019433600, and this is php timestamp, now with MYSQL TIMESTAMP I have 20001020193600.
is this value ok or not.

Problem two:
I'm have this vars to build the date:
$_POST[year], $_POST[month], $_POST[day]

and on the insert query I'm doing this:

... UNIX_TIMESTAMP('$_POST[year]-$_POST[month]-$_POST[day]')...

and it's inserting different values.

Can you help me with this?

Reply With Quote
  #2  
Old January 29th, 2003, 10:16 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
i don't quite understand your second problem... but to answer your first problem, look at the last ten digits of your time stamp... it's the same thing except the new version includes a year-field.

as far as how your program interprets it, that's up to you...

Reply With Quote
  #3  
Old February 1st, 2003, 02:11 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Re: Different problem with TIMESTAMP

Quote:
Originally posted by Neworld
In reality I have two problems.

Problem two:
I'm have this vars to build the date:
$_POST[year], $_POST[month], $_POST[day]

and on the insert query I'm doing this:

... UNIX_TIMESTAMP('$_POST[year]-$_POST[month]-$_POST[day]')...

and it's inserting different values.

Can you help me with this?


Neworld,

You may want to store the value in a variable, and then use that variable for your insert:

PHP Code:
 $timestamp $_POST['year'] . "-" $_POST['month'] . "-" $_POST['day'];
... 
UNIX_TIMESTAMP($timestamp); 


Give that a try.
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Different problem with TIMESTAMP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT