سؤال

I usually keep the date as timestamp in sql.

But now Im doing a project that I want that the date appears like "Wednesday, 30 April, 2014".

And Im using datepicker to format the date like I want and its working fine.

$('.datepicker').datepicker({
    dateFormat: 'DD, d MM, yy',         
});

But now I am in doubt, if it is appropriate to save date as varchar, but also dont seems possible to save "Wednesday, 30 April, 2014" as timestamp or datetime or someting else date option.

What do you think its better?

هل كانت مفيدة؟

المحلول

Use DateTime or TimeStamp but do not use a VarChar.

What do you think its better?

This type of question are problematic on StackOverflow, but it has been asked before.

If you ever store it as a VARCHAR it will make your life very hard. Because doing calculation on dates will just be a real hassle.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top