If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Date, DateTime, Time, Timestamp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-02-06, 15:21
screenmates screenmates is offline
Registered User
 
Join Date: Jul 2005
Posts: 63
Date, DateTime, Time, Timestamp

Hello,

For storing date, date-time and time values, what data-type do you recommend? Is timestamp type a better approach for performance, ease-of-use and maintainability? Is timestamp better for a locale-specific i18n/i10n application? What happens after year 2037 that is the threshold for timestamp type?

Last edited by screenmates; 06-02-06 at 15:35.
Reply With Quote
  #2 (permalink)  
Old 06-02-06, 19:19
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
For storing date, date-time and time values, what data-type do you recommend?

DATE, DATETIME, and TIME (respectively)


Is timestamp type a better approach for performance, ease-of-use and maintainability?

better than DATETIME? no

but TIMESTAMP can be set to update automatically


What happens after year 2037 that is the threshold for timestamp type?

nothing

perhaps you're thinking of the unix timestamp, but you need to store that type of value in an INTEGER

TIMESTAMP is different
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 06-02-06, 20:52
screenmates screenmates is offline
Registered User
 
Join Date: Jul 2005
Posts: 63
Oops! I meant unix-timestamp as unsigned integer. Please clarify if unix-timestamp is a better approach than date/datetime types for an i18n/i10n application and for performance, ease-of-use and maintainability.

TIA

Last edited by screenmates; 06-02-06 at 20:58.
Reply With Quote
  #4 (permalink)  
Old 06-03-06, 17:04
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Quote:
Originally Posted by screenmates
Please clarify if unix-timestamp is a better approach than date/datetime types for an i18n/i10n application and for performance, ease-of-use and maintainability.
no, i don't think it is
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On