Re: Dates
| From: | Micah Stevens | Date: | Fri, 27 Sep 2002 21:03:06 +0000 |
| Subject: | Re: Dates | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-22056@lists.php.net to get a copy of this message | ||
May I recommend setting the field type to INT, and just using timestamps? That's what I usually do, then you can manipulate things however you want. Much more convenient than the date style type I think. Looking at how the MySQL docs talk about the DATETIME field, I bet the database is doing just that, but converting for you. If you use the PHP date/time functions instead to convert you have a lot more control.
-Micah
At 09:38 PM 9/27/2002 +0100, Steve Vernon wrote:
Hiya,I am doing a database of things that have dates, some I know the month and year of, some I only know the year. I suppose I could do a field for the year, and one for month, and then allow the month to be NULL. But is there a date type that allows years and / or months???Thanks,Steve----------_.-..-``Stephen Vernon Mobile 07971 446 956 Mobile 07971 446 956---._..`\--.._ ../\-._`-._ _/_ o \ _.-``.. \-._ _>=-. _.-\_\ \ o. (_.__./ / |---._##.` -\ o.-----_o \#// / \ _.._ \ o _.-........-_.-\_.\-<`\ | .|-.___\-o__.-._.._..-.\ |/ \__...--.-\____.-_.--````. |) | _|.-`\_...-\ /... // \/.#####.=._ /_ \ \....._/ \`// \#####_.--|_--.\ __. \\_... ``````--._|__```````\.._.\-\ \ ````````\ \ \. ` \..`. \ | \. \-~\. \ _..--`` Stephen Vernon, recently graduated from the University of Sheffield, where I studied Computer Science. I could do with a job!