I agree.
However I have been doing nothing but reading for the last few days about timestamp.
I read this:-
The DATE type is used when you need only a date value, without a time part. MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format. The supported range is '1000-01-01' to '9999-12-31'.
which would be perfect, but i cant set the database field to date. Im using phpMyAdmin, and there is no date function.
so i tried
TIMESTAMP( 8 ) YYYYMMDD
which I dont mind using just a bit of parsing to get the right date, however when INSERTING into my database it wont let me.
so i thought and read some more, that my string
has to be a vaild date.
so i set off with both maketime and strtotime
(i was told strtotime was faster, but im not intrested in speed really)
Code: Select all
list($day, $month, $year) = explode("-", $date_of_birth);
$updated_date_of_birth = ("$year-$month-$day");
$new_date_of_birth = mktime (0,0,0,$month,$day,$year);
nope that didnt work, just outputted a series of numbers..
then
Code: Select all
list($day, $month, $year) = explode("-", $date_of_birth);
$updated_date_of_birth = ("$year-$month-$day");
$new_date_of_birth = strtotime("$updated_date_of_birth");
nope that didnt work.
Then i thought going back to the linux timestamp 'was this series of numbers the amount of seconds past'?
nope, however doing the same back work, that is "strftime"
Im completely lost. and confused. mySQL says timestamp is YYYYMMDD yet php is outputing a series of numbers 360545600.
This date thingy is done everywhere so why am i having such a problem with it?