Jump to content

Recommended Posts

Hi

 

I want to store the mJoinDate and mLastLogin of a particular user.

 

Initially, I had for the first field:

[php:1:b3f9e28bcf]`mJoinDate` timestamp(14) NOT NULL,[/php:1:b3f9e28bcf]

 

Then, when I realised I need mLastLogin, I saw a tutorial and in that they were both as:

[php:1:b3f9e28bcf]signup_date datetime NOT NULL default \'0000-00-00 00:00:00\',

last_login datetime NOT NULL default \'0000-00-00 00:00:00\', [/php:1:b3f9e28bcf]

So what I am wondering is, which \'type\' should I use - timestamp or datetime?

 

Thanks.

 

Mak :)

Link to comment
https://forums.phpfreaks.com/topic/741-quick-date-question-guysgirls/
Share on other sites

Use timestamp when you want to record when the record was added or last updated. This will happen automatically if you do not write a value to it (or write NULL to it). (But only for one timestamp field per record).

 

If the time is not relevant, just use DATE type (eg birthdays, date joined etc)

 

hth

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.