Re: [PHP] Re: date problem

2005-06-29 Thread Mario netMines
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: php-general@lists.php.net Sent: Wednesday, June 29, 2005 7:49 AM Subject: Re: [PHP] Re: date problem Mario netMines wrote

[PHP] Re: date problem

2005-06-28 Thread Jasper Bryant-Greene
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

Re: [PHP] Re: date problem

2005-06-28 Thread Mario netMines
, 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 shouldn't

Re: [PHP] Re: date problem

2005-06-28 Thread Jasper Bryant-Greene
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

[PHP] Re: date problem

2003-09-24 Thread John
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', surely

Re: [PHP] Re: date problem

2003-09-24 Thread Robert Cummings
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(),

[PHP] Re: date problem

2003-03-19 Thread Philip Hallstrom
Try: $ts = time(); $i = 0; while( $i 2 ) { $day = date(dS, $ts + $i * 86400); print(td$day/td); $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){ $day++;

[PHP] Re: date problem

2003-02-27 Thread R'twick Niceorgaw
$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

[PHP] Re: Date() Problem

2002-07-27 Thread Jome
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 in

[PHP] Re: Date() Problem

2002-07-27 Thread Tony Harrison
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 the

[PHP] Re: Date() Problem

2002-07-27 Thread Jome
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

[PHP] Re: Date() Problem

2002-07-27 Thread JJ Harrison
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

[PHP] Re: Date() Problem

2002-07-27 Thread Tony Harrison
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 UNIX

Re: [PHP] Re: Date() Problem

2002-07-27 Thread Justin French
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

RE: [PHP] Re: Date() Problem

2002-07-27 Thread John Holmes
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

[PHP] Re: date problem

2002-04-28 Thread Yuri Petro
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] ???/ ? ?: [EMAIL

[PHP] Re: date problem

2002-02-18 Thread Julio Nobrega Trabalhando
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

[PHP] Re: Date Problem

2001-11-28 Thread lallous
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 have

[PHP] Re: Date Problem

2001-11-21 Thread David Tod Sigafoos
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

[PHP] Re: Date Problem

2001-11-21 Thread George Whiffen
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 months to

[PHP] Re: date problem

2001-11-01 Thread Chris Lee
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: OS: