Re: [PHP-DB] Dates - Best Approach

2007-09-10 Thread Goltsios Theodore
If you are using unix-like OSes then you could write a program or a script using (PHP, perl, bash, csh even C) whatever it suits you and use cron daemon to run it every month. This script should query the database and find out if is needed to be sent. The alternative (not the suggested so

[PHP-DB] Dates - Best Approach

2007-09-07 Thread Malcolm Clark
Hi! I am designing a contact management system, so that entries (client records) can be flagged, so that an email is sent out after 'n' months, to remind the user to contact this particular client. So, there would simply be a drop down menu with options: None, 1 month, 2 month, ... 12 months

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

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

2004-12-14 Thread Frank Marousek
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 $new_date_formatted; It appears that all dates prior to Dec 31, 1969 are displayed as 12

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 $row_SearchPlayerRcrdSt['D

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 - adding to unix 86400 seconds not equal nextday

2004-09-02 Thread ioannes
E_ADD(arrival,INTERVAL nights-1 DAY) >'$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:

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
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 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 probab

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 - 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. I

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
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

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 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 j

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 nextd

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

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

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

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

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 -

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:

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/)

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, 20

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 200431 10 2004" so, y added..: $next+=(60*60*24); print(""); $thisdate=date("d m Y",$next); print($thisdate); and the output is: "30 10 200431 10 200401 11 2004" nice Ref: Server: Apache/1.3.26 (Unix) PHP/4.3.8 On Wed, 1 Sep 2004 13:49:33 +0100,

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 John Holmes
From: "ioannes" <[EMAIL PROTECTED]> "); $thisdate=date("d m Y",$next); print($thisdate); ?> I get 30 10 2004 31 10 2004 So what's the issue? You could also use this: print(date('d m Y H:i:s')); print(''); print(date('d m Y H:i:s',strtotime('+1 day'))); ---John Holmes... -- PHP Database Mailing List

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

2004-09-01 Thread ioannes
Code: "); $thisdate=date("d m Y",$next); print($thisdate); ?> how come? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re[2]: [PHP-DB] Dates and Count

2004-07-05 Thread Pablo M. Rivas
Hello Shannon, mmhh.. i think this is simple as: Select * from mytable where nextcontact>='$today' and nextcontact<='$week' and (custid=3 or custid=5) and (languaje='de' or languaje='en') I'm not sure if it helps, but you can ask again or provide an example... ;) SD> Secon

RE: [PHP-DB] Dates and Count

2004-07-05 Thread zareef ahmed
nt to > search from a variety of > different fields, show those that are between the > dates and are equal to one > other criteria. > > Any help on these two? > > Cheers, > > Shannon > > > -Original Message----- > From: Pablo M. Rivas [mailto:[EMA

RE: [PHP-DB] Dates and Count

2004-07-04 Thread Shannon Doyle
ECTED] 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 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 d

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

[PHP-DB] Dates and Count

2004-06-27 Thread Shannon Doyle
Hi People, I have two queries for the list:- First, I have two dates stored in a MySQL DB that I want to do a compare on and then only display via a web page those records that have a 5 or greater day difference in them. What would be the best way to achieve this. Second, I want to be able to r

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 h

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

[PHP-DB] dates and updates recommendation?

2003-01-26 Thread Paul Chvostek
Hiya. I'm looking for some design advice. I have a number of tables whose data consist of configuration details and parameters that are incorporated into config files for various server applications. For example, a table of customers' email address forwarding info, so a PHP application can be u

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 y

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 j

[PHP-DB] Dates

2002-09-27 Thread Steve Vernon
Hiya,     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???       Tha

Re: [PHP-DB] Dates in MYSQL

2002-04-17 Thread DL Neil
"%D %M %Y") as > > evdt FROM notices WHERE eventdate >= $todaysdate ORDER BY > > eventdate"; > > > > > > > > > > Mike > > - Original Message - > > From: "Alex Francis" <[EMAIL PROTECTED]&

Re: [PHP-DB] Dates in MYSQL

2002-04-17 Thread Alex Francis
> $query = "SELECT id, eventheading, DATE_FORMAT(eventdate, "%D %M %Y") as > evdt FROM notices WHERE eventdate >= $todaysdate ORDER BY > eventdate"; > > > > > Mike > ----- Original Message - > From: "Alex Francis" <[EMAIL PROTECTE

Re: [PHP-DB] Dates in MYSQL

2002-04-17 Thread Mike
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, even

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( mysql_e

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 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 WHERE date >= datevar (variable with current da

[PHP-DB] dates in MYSQL

2002-04-17 Thread Alex Francis
This may be a stupid question but I am a complete newbie. I am trying to automatically drop events from a noticeboard when the date has passed. I have stored the date of the event in the database in the form -MM-DD and wish to SELECT From the database WHERE date >= todays date. Is this possib

Re: [PHP-DB] dates in db

2002-01-05 Thread Stephen Abshire
shall they believe in him of whom they have not heard? and how shall they hear without a preacher? - Original Message - From: "Adam Jackson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 05, 2002 8:28 PM Subject: [PHP-DB] dates in db i have a

[PHP-DB] dates in db

2002-01-05 Thread Adam Jackson
i have a date in my mysql database in the format of 20011201 how do I output that to show for example 01 December 2001 or something similar? Cheers Adam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE