May 29, 2006 at 6:25 am
· Filed under PHP Community, MySQL Community
can php handle mysql datetime values as-is in the date() function?
im pretty sure mysql internalyl stores date/datetime as a unix EPOCH time
Or do you still need to pass unix timestamps to that.
it wouldnt make any sense to do it any other way
Chambrln, http://uk2.php.net/manual/en/function.ldap-connect.php
check the first comment
it just displays it differently
qurve: date() still needs unix timestamps.. you can use date_format() in the query though
Action: qurve is annoyed that mysql does not support expressions for default values
EXACTLY what you want
arpad: unix_timestamp(col) will work
but you can use strtotime too erf
echo date('M d y', strtotime($some_mysql_datetmie));
qurve: yeah, and from_unixtime() to go the other way
codepoet, I was talking to Chambrln
Ah ok
mysql stillc an't default a col value to a function, so annoying.
erf: alreday doing that. I think it's a problem with the novell server. I hate novell
yea it can
sort of
mysql got pain in the arse instead of datetime
you mean like a timestamp?
there is a timestamp data type :-p
qurve: might be doable with a trigger or something
well im using uuids for my primary keys
which sets any time you do something to the table
I tried to default my id columns to UUID()
and mysql was like 'uh, no'
ah heh
Can onyl be constant values.
I hate to say it, but mssql > *
for databases.
i prefer postgres
I never would have guessed it, but that's what I work with all day at work.
yes cause MS had so much insight with Access
Lets not make this into a database discussion.
Working with anything else now just seems like a big downgrade.
tsql is annoyingly limited
It's like replacing the wheels on your car with squares.
Chambrln, so do I, easy to hack tho
Either wya, you've all answered my question, I'll use DATETIME 
qurve: http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html
qurve: If you want a default value that's variable.
erf: will you hack mine so maybe we can get rid of it?
heh
Easy to hack from the inside that is

well I'm sure I could leave the back door open for you
jome, thanks ill look into that.
Permalink