How would i send time to the database like
hours minutes (5:55PM)
and date like
day/month (11/03)
i want them in to seperate varibles ive googled it but alls ive found is them together
date("d/m/y : H:i:s", time());
but i want to send them to the database as ive put and seperate
thanks
time & date
time & date
I would put a signature.. BUT, i don't have the time.
Re: time & date
so you want a single field for the individual parts of the date and time?
to break them up into individual variables, assign each one individually.
[syntax=php]
$day = date("d", time());
$month = date("m", time());
... etc
[/syntax]
to break them up into individual variables, assign each one individually.
[syntax=php]
$day = date("d", time());
$month = date("m", time());
... etc
[/syntax]
Re: time & date
Torniquet wrote:so you want a single field for the individual parts of the date and time?
to break them up into individual variables, assign each one individually.
[syntax=php]
$day = date("d", time());
$month = date("m", time());
... etc
[/syntax]
no i want
time as $time = 5:55PM or whatever the current time is but as that format
date as $date = 10/03 (day/Month) or whatever the current date is but as that format
I would put a signature.. BUT, i don't have the time.
Re: time & date
If you store the time as a DATETIME column you can then use the DATE_FORMAT() mysql function to format it how you like when selecting the data.
Re: time & date
jacek wrote:If you store the time as a DATETIME column you can then use the DATE_FORMAT() mysql function to format it how you like when selecting the data.
expand on this please? first time ive heard anything about this?
I would put a signature.. BUT, i don't have the time.
Re: time & date
ashwood wrote:jacek wrote:If you store the time as a DATETIME column you can then use the DATE_FORMAT() mysql function to format it how you like when selecting the data.
expand on this please? first time ive heard anything about this?
http://www.w3schools.com/sql/func_date_format.asp