Isn't DATEDIFF() a MySQL 4.x function? The server I'm using has 3.x and I
can't upgrade...
- Original Message -
From: "Jasper Bryant-Greene" <[EMAIL PROTECTED]>
To:
Sent: Wednesday, June 29, 2005 7:49 AM
Subject: Re: [PHP] Re: date problem
Mario
Mario netMines wrote:
> Hi Jasper and thanks for the quick reply.
>
> something tells me it's not a straightforward SQL query that I have to
> use here but a logic using PHP and SQL.
Please don't top-post.
It can be done in SQL quite easily, as can many things people use PHP
for. Go to the MySQL
2005 4:28 AM
Subject: [PHP] Re: date problem
Firstly, this shouldn't be in the PHP list, as you're asking for help
with SQL.
Mario netMines wrote:
carrental_from (datetime field)
carrental_to (datetime field)
carrental_price (datetime field) [rates are per hour]
carrental_price shoul
Firstly, this shouldn't be in the PHP list, as you're asking for help
with SQL.
Mario netMines wrote:
> carrental_from (datetime field)
> carrental_to (datetime field)
> carrental_price (datetime field) [rates are per hour]
carrental_price shouldn't be a datetime field, as it isn't a datetime val
>From the documentation:
http://ca2.php.net/manual/en/function.mktime.php
"Date with year, month and day equal to zero is considered
illegal (otherwise it what be regarded as 30.11.1999, which
would be strange behavior)."
I think the point here to think about is that the date()
For me, on Windows, it won't work because Windows won't do anything prior to
1970.
On linux, I get 17 as the result. If I change the year to 2000, then I get
08 on both.
John
"Shaun" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Why does the following code print '00', su
Try:
$ts = time();
$i = 0;
while( $i < 2 ) {
$day = date("dS", $ts + $i * 86400);
print("$day");
$i++;
}
On Wed, 19 Mar 2003, shaun wrote:
> hi,
>
> using date(dS); how can i can increase the days so that it shows
>
> 19th 20th 21st
>
> I have tried
>
> while ($i < 2){
>
$date_array=explode("-",$newdate);
$day = $date_array[2];
$month = $date_array[1];
$year = $date_array[0];
Or,
$timestamp - strtotime($newdate);
$today = getdate($timestamp);
$month = $today['month'];
$mday = $today['mday'];
$year = $today['year'];
"Alexander Tsonev" <[EMAIL PROTECTED]> wrote in
> I store all dates in unix timestamp format. It's the easiest one to
work
> with, and it's easy to do things like "date + three days", because
it's
> just
> a case of adding the right number of seconds to the current stamp.
>
> You don't have to split anything, or get substr()'s of anything...
I store all dates in unix timestamp format. It's the easiest one to work
with, and it's easy to do things like "date + three days", because it's just
a case of adding the right number of seconds to the current stamp.
You don't have to split anything, or get substr()'s of anything... and since
da
I tried using UNIX stamps but it dont work, and why the hell does it default
to that date anyway? I thought it was supposed to default to the current
time?
"Jj Harrison" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Alternativly you could store the dates as U
Alternativly you could store the dates as UNIX timestamps.
That is what I do. It is then eaiser to do certian things(ie show stuff
released in the last month)
--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com
"Tony Harrison" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PRO
> Yeh, ive allready looked at that before, but where and when do i use
> DATE_FORMAT() ? When im inserting the row or selecting it?
>
Replace your existent query with this one and try:
SELECT
`artist_id`,`title`,`content`,`user_id`,DATE_FORMAT(date,'%d-%m-%Y
%H:%i:%s'),`type`,`views` FROM
`resou
Yeh, ive allready looked at that before, but where and when do i use
DATE_FORMAT() ? When im inserting the row or selecting it?
"Jome" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi, im making a tab/lyric portal, and for viewing tabs i want to display
> t
> Hi, im making a tab/lyric portal, and for viewing tabs i want to display
the
> time the lyric/tab was submitted. So I retrive it from a MySQL database
(as
> a timestamp) and format it using the date function. The problem is, that
the
> date: 19-01-2038 04:14:07 is allways returned, even though i
You can include date formatting function in your SQL statement:
DATE_FORMAT(date,format)
http://www.mysql.com/doc/D/a/Date_and_time_functions.html
--
Kind regards,
Yuri.
www.AceHoster.com Quality web hosting
"Nick Wilson" <[EMAIL PROTECTED]> ???/ ? ?:
[EM
Mysql?
INSERT INTO table VALUES (NOW());
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
"Eoghan" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">new
you can use the MySql's function:
DATE_ADD(datefield, INTERVAL 3 MONTH)
"Mindhunter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I am reading a date from an input in format 'DD-MM-' ex. 10-11-2001.
> Now I want to add 3 months to the date. I h
Mindhunter wrote:
>
> Hi,
>
> I am reading a date from an input in format 'DD-MM-' ex. 10-11-2001.
> Now I want to add 3 months to the date. I have tested mktime and strftime
> etc and no matter what I do I get the year as 1970. (Systemdate works
> fine). How would I go about adding 3 mon
On Wed, 21 Nov 2001 09:31:33 +0200, [EMAIL PROTECTED]
(Mindhunter) wrote:
>I am reading a date from an input in format 'DD-MM-' ex. 10-11-2001.
>Now I want to add 3 months to the date. I have tested mktime and strftime
>etc and no matter what I do I get the year as 1970. (Systemdate works
>
date() shoudl give you the time in your timezone, gmdate() should give you
the time in the GMT timezone. I would check your server and make sure the
timezone is correctly set.
--
Chris Lee
[EMAIL PROTECTED]
"Steve Tsai" <[EMAIL PROTECTED]> wrote in message news:none...
> For reference:
>
21 matches
Mail list logo