Re: [PHP-DB] Dates prior to Dec 31, 1969

2004-12-15 Thread Frank Marousek
Ramil and Jochem, Having mySQL format the date is the best solution... thanks! Frank -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Dates prior to Dec 31, 1969

2004-12-14 Thread Ramil Sagum
On Tue, 14 Dec 2004 15:39:52 -0600, Frank Marousek [EMAIL PROTECTED] wrote: I'm using the following code to display dates returned from a query of a mySQL database. $new_timestamp = strtotime($row_SearchPlayerRcrdSt['Date']); $new_date_formatted = date (m/d/y, $new_timestamp); echo

Re: [PHP-DB] Dates prior to Dec 31, 1969

2004-12-14 Thread Jochem Maas
Frank Marousek wrote: I'm using the following code to display dates returned from a query of a mySQL database. What kind of field is it? (int,timestamp,datetime,etc) $new_timestamp = strtotime($row_SearchPlayerRcrdSt['Date']); what do the following contain: $new_timestamp

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-02 Thread ioannes
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

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-02 Thread ioannes
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

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-02 Thread Ed Lazor
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

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-02 Thread ioannes
) '$thisdate'; INTERVAL means what it says, so from 1/1/04 add an interval of 1 gives 3/1/04, not 2/1/04. Hence my -1. John - Original Message - From: ioannes [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 02, 2004 7:42 PM Subject: Re: [PHP-DB] Dates - adding to unix 86400

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal next day

2004-09-01 Thread John Holmes
From: ioannes [EMAIL PROTECTED] ? //unix date is 1099177200 seconds since 01/01/1970 //date based on unix 31 10 2004 $thisdate=date(d m Y,1099177200); print($thisdate); $next=1099177200+60*60*24; //86400 //add 86400 should give next unix date //date based on this is also 31 10 2004 print(br);

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal next day

2004-09-01 Thread Craig Brothers
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:49, ioannes wrote: Code: ? //unix date is 1099177200 seconds since 01/01/1970

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal next day

2004-09-01 Thread Pablo Rivas
I don't get you... your code outputs: 30 10 2004br31 10 2004 so, y added..: $next+=(60*60*24); print(br); $thisdate=date(d m Y,$next); print($thisdate); and the output is: 30 10 2004br31 10 2004br01 11 2004 nice Ref: Server: Apache/1.3.26 (Unix) PHP/4.3.8 On Wed, 1 Sep 2004 13:49:33

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread ioannes
When I run this code I get: 31 10 2004 31 10 2004 http://www.shortstay-london.com/testdates.php - Original Message - From: Craig Brothers [EMAIL PROTECTED] To: ioannes [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, September 01, 2004 2:00 PM Subject: Re: [PHP-DB] Dates - adding

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread John Holmes
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/) To

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread ioannes
[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: [PHP-DB] Dates - adding to unix 86400 seconds

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread John Holmes
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 - I

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread Craig Brothers
: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday 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

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread ioannes
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 nextday From: ioannes [EMAIL PROTECTED] Sunday 31st

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread John Holmes
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 just

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread Simon Rees
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

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread ioannes
Message - From: Simon Rees [EMAIL PROTECTED] To: ioannes [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, September 01, 2004 3:16 PM Subject: Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday Isn't this due to how your operating system handles the switch from daylight

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread ioannes
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

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread ioannes
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. Is

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread ioannes
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

RE: [PHP-DB] Dates and Count

2004-07-05 Thread zareef ahmed
. Any help on these two? Cheers, Shannon -Original Message- From: Pablo M. Rivas [mailto:[EMAIL PROTECTED] Sent: Monday, 28 June 2004 9:21 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Dates and Count Hello Shannon, SD First, I have two dates stored in a MySQL DB

RE: [PHP-DB] Dates and Count

2004-07-04 Thread Shannon Doyle
To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Dates and Count Hello Shannon, SD First, I have two dates stored in a MySQL DB that I want to do a compare on SD and then only display via a web page those records that have a 5 or greater SD day difference in them. What would be the best way to achieve

Re: [PHP-DB] Dates and Count

2004-06-28 Thread Pablo M. Rivas
Hello Shannon, SD First, I have two dates stored in a MySQL DB that I want to do a compare on SD and then only display via a web page those records that have a 5 or greater SD day difference in them. What would be the best way to achieve this. Depends on your mysql version... select * from

Re: [PHP-DB] dates and updates recommendation?

2003-01-26 Thread Jason Wong
On Sunday 26 January 2003 17:02, Paul Chvostek wrote: So what's the best way to store a date? I've always liked storing epoch seconds as INTs, and leaving the translation to/from a human-readable date up to the application, but aside from the relative unreadability of this, are there any

RE: [PHP-DB] dates and updates recommendation?

2003-01-26 Thread John W. Holmes
[snip] Would I be better off spending a few bytes extra per record and storing things as DATETIME rather than an INT? If I'm looking at the possibily making the application more database-portable in the future, are there gotchas I should be aware of with any particular field types? This has

Re: [PHP-DB] Dates

2002-09-27 Thread Micah Stevens
May I recommend setting the field type to INT, and just using timestamps? That's what I usually do, then you can manipulate things however you want. Much more convenient than the date style type I think. Looking at how the MySQL docs talk about the DATETIME field, I bet the database is doing

RE: [PHP-DB] Dates

2002-09-27 Thread John Holmes
    I am doing a database of things that have dates, some I know the month and year of, some I only know the year. I suppose I could do a field for the year, and one for month, and then allow the month to be NULL. But is there a date type that allows years and  / or months??? If that's all you

Re: [PHP-DB] Dates in MYSQL

2002-04-18 Thread DL Neil
ventdate = $todaysdate ORDER BY eventdate; Mike - Original Message - From: Alex Francis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 17, 2002 5:26 PM Subject: Re: [PHP-DB] Dates in MYSQL Tried the following as suggested - Still no dates showing

RE: [PHP-DB] dates in MYSQL

2002-04-17 Thread Ruprecht Helms
Hi Alex Francis, SELECT From the database WHERE date = todays date. ^ somethink like now() or date() an other method you put the date in a variable that you get by the datecommand and make SELECT From table WHERE date = datevar (variable with current

Re: [PHP-DB] Dates in MYSQL

2002-04-17 Thread DL Neil
Hi Alex, Got my select statement to work as follows: $query = ' SELECT * FROM notices WHERE TO_DAYS(eventdate) = TO_DAYS(now()) order by eventdate'; =well done! However the TO-DAYS calls do seem a bit OTT. Please post the schema for tbl:notices - specifically the datatype for eventdate.

Re: [PHP-DB] Dates in MYSQL

2002-04-17 Thread Alex Francis
Tried the following as suggested - Still no dates showing $query = ' SELECT id, eventheading, DATE_FORMAT(eventdate, %D %M %Y)as evdt FROM notices WHERE TO_DAYS(eventdate) = TO_DAYS(now()) order by eventdate'; $result=mysql_db_query($dbname, $query, $link); if (!$result) { echo(

Re: [PHP-DB] Dates in MYSQL

2002-04-17 Thread Mike
PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 17, 2002 5:26 PM Subject: Re: [PHP-DB] Dates in MYSQL Tried the following as suggested - Still no dates showing $query = ' SELECT id, eventheading, DATE_FORMAT(eventdate, %D %M %Y)as evdt FROM notices WHERE TO_DAYS(eventdate) = TO_DAYS(now

Re: [PHP-DB] Dates in MYSQL

2002-04-17 Thread Alex Francis
te ORDER BY eventdate; Mike - Original Message - From: Alex Francis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 17, 2002 5:26 PM Subject: Re: [PHP-DB] Dates in MYSQL Tried the following as suggested - Still no dates showing $query = ' SELECT id, eventheading, DAT

Re: [PHP-DB] dates in db

2002-01-05 Thread Stephen Abshire
Try something like: date_format(news_date, '%d %M %Y @ %H:%I:%S') Go to http://www.mysql.com/doc/D/a/Date_and_time_functions.html and look for date_format to determine what parameters to use in order to format the date as you want it. Note that this method will actually format the date