Thursday, September 02, 2004 7:42 PM
Subject: Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday
The answer seems to be DATE_ADD but I haven't got it to work yet...asking
the MySQL people.
I need to do this in a SQL query:
(arrival+nights)>='$thisdate'
--
PHP D
Quoting ioannes <[EMAIL PROTECTED]>:
> The answer seems to be DATE_ADD but I haven't got it to work yet...asking
> the MySQL people.
Check your version of MySQL... I think that's a newer function.
-Ed
This message was sent using
The answer seems to be DATE_ADD but I haven't got it to work yet...asking
the MySQL people.
I need to do this in a SQL query:
(arrival+nights)>='$thisdate'
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sorry to visit this once again, but this is a problem with bits the solution
to which causes other problems.
I need to do this in a SQL query:
(arrival+nights)>='$thisdate'
'arrival' is a date field, and 'nights' is an integer, so the above makes no
sense, being like 2004/12/31+7 which is probab
Final problem on this was adding a number of nights to an arrival date in a
query:
$query="SELECT field FROM Table WHERE
(UNIX_TIMESTAMP(arrival)+nights*86400-86400+3600)>='$thisdate')";
When the arrival date is in Summer, adding a number of night requires
adjusting for the hour [3600], because
I'd still like to find out if there is a mysql equivalent of gmmktime for
use in queries like:
"SELECT UNIX_TIMESTAMP(mydate) FROM MyTable WHERE
UNIX_TIMESTAMP(mydate)<='$thisdate'";
and $thisdate is a gm date. Otherwise I need to convert the GMT date back
to Summer time just for the query. I
Of course, it's because the whole of Summer is an hour out and this changes
31 Oct. I had it backwards.
I'd still like to find out if there is a mysql equivalent of gmmktime for
use in queries like:
"SELECT UNIX_TIMESTAMP(mydate) FROM MyTable WHERE
UNIX_TIMESTAMP(mydate)<='$thisdate'";
and $
e above SQL gave the wrong date with mktime when the date was 9
October
Thanks,
John
- Original Message -
From: "Simon Rees" <[EMAIL PROTECTED]>
To: "ioannes" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, September 01, 2004 3:16 PM
Subjec
Isn't this due to how your operating system handles the switch from
daylight saving time to GMT (or local equivilent)? Or is this handled by
PHP? That could account for different experiences. Of course if your
locale doesn't switch from DST on this date you won't see the issue
either...
Using
From: "Craig Brothers" <[EMAIL PROTECTED]>
I think your problem might be due to daylight savings time. 10/31/04 is
the day that the clocks get set back 1 hour (at 2am). therefore we have
25 hours in the day on 10/31.
not sure how to get around it though, or why my system accounts for it.
You're j
Magnificent.
- Original Message -
From: "John Holmes" <[EMAIL PROTECTED]>
To: "ioannes" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, September 01, 2004 3:10 PM
Subject: Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextd
D]>
Sent: Wednesday, September 01, 2004 2:53 PM
Subject: Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday
Sunday 31st of October 2004 12:00:00 AM unix: 1099177200 - first day
Saturday 30th of October 2004 12:00:00 AM unix: 1099090800 - previous day
Sunday 31st of October 2004 11:00:
PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, September 01, 2004 2:31 PM
> Subject: Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday
>
>
> > From: "ioannes" <[EMAIL PROTECTED]>
> >
> >> When I run this code I get
From: "ioannes" <[EMAIL PROTECTED]>
Sunday 31st of October 2004 12:00:00 AM unix: 1099177200 - first day
Saturday 30th of October 2004 12:00:00 AM unix: 1099090800 - previous day
Sunday 31st of October 2004 11:00:00 PM unix: 1099263600 - day after first
day
if I add 86400 to first - 1099177200 -
[day after first day above], but this gives me 11pm on 31 Oct as above.
?
- Original Message -
From: "John Holmes" <[EMAIL PROTECTED]>
To: "ioannes" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, September 01, 2004 2:31 PM
Subject: Re:
From: "ioannes" <[EMAIL PROTECTED]>
When I run this code I get:
31 10 2004
31 10 2004
http://www.shortstay-london.com/testdates.php
Try printing out the hours, minutes and seconds along with the date and
you'll see the issue.
---John Holmes...
--
PHP Database Mailing List (http://www.php.net/)
04 2:00 PM
Subject: Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday
what are you seeing for output?
When I run your code I get the following
30 10 2004
31 10 2004
running on Fedora Core 1, Apache 2.0.5, PHP 5.0.1
--
Craig Brothers
[EMAIL PROTECTED]
On Wed, 2004-09-01 at 08:
17 matches
Mail list logo