[PHP-DB] Date formatting question

2009-04-08 Thread Jack Lauman
I need to reformat the output of the 'dates' field from '2009-04-08' to 'Wed. Apr. 8th'. Any help would be appreciated. Thanks. --- for ($counter = 0; $counter mysql_num_rows($resultID); $counter++); while ($row = mysql_fetch_object($resultID)) { print tr; print td . $row-dates .

Re: [PHP-DB] Date formatting question

2009-04-08 Thread Chris
Jack Lauman wrote: I need to reformat the output of the 'dates' field from '2009-04-08' to 'Wed. Apr. 8th'. Any help would be appreciated. You can either do it using mysql date formats (see http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format) or something

Re: [PHP-DB] Date formatting question

2009-04-08 Thread Phpster
See the date function Http://www.php.net/date Bastien Sent from my iPod On Apr 8, 2009, at 21:41, Jack Lauman jlau...@nwcascades.com wrote: I need to reformat the output of the 'dates' field from '2009-04-08' to 'Wed. Apr. 8th'. Any help would be appreciated. Thanks. --- for ($counter

Re: [PHP-DB] Date Translation in MySQL

2008-08-10 Thread Bastien Koert
On Tue, Aug 5, 2008 at 4:33 PM, Ben Miller [EMAIL PROTECTED]wrote: Figured there had to be an easier way. Thank you so much. -Original Message- From: Simcha Younger [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 05, 2008 2:48 PM To: php-db@lists.php.net Subject: RE: [PHP-DB] Date

[PHP-DB] Date Translation in MySQL

2008-08-05 Thread Ben Miller
I'm looking for a quick and simple way to query a MySQL database by date, or more specifically, by day of the week. My dates are stored in the DB in -MM-DD HH:MM:SS format. Question, is there a built-in for PHP or MySQL that will take this column and return only Saturdays, for example,

RE: [PHP-DB] Date Translation in MySQL

2008-08-05 Thread Simcha Younger
Select * FROM ... WHERE DAYOFWEEK(datecol)=7 -Original Message- From: Ben Miller [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 05, 2008 8:10 PM To: PHP. DB Mail List Subject: [PHP-DB] Date Translation in MySQL I'm looking for a quick and simple way to query a MySQL database by date

RE: [PHP-DB] Date Translation in MySQL

2008-08-05 Thread Ben Miller
Figured there had to be an easier way. Thank you so much. -Original Message- From: Simcha Younger [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 05, 2008 2:48 PM To: php-db@lists.php.net Subject: RE: [PHP-DB] Date Translation in MySQL Select * FROM ... WHERE DAYOFWEEK(datecol)=7

[PHP-DB] Date calculation from MySql table

2008-04-12 Thread A. Joseph
I want to calculate the registed users today Also total users this week Total users this month Total users this year The Mysql table has a row of INT(11) with time() value inserted. I did something like this $today = strtotime(+1 day) Then $sql = SELECT COUNT(*) FROM table WHERE dateReg =

Re: [PHP-DB] Date calculation from MySql table

2008-04-12 Thread Evert Lammerts
Something like this should work. $today = mktime(0, 0, 0, date(m), date(d), date(Y)); $tomorrow = mktime(0, 0, 0, date(m), date(d) + 1, date(Y)); $sql = SELECT COUNT(*) FROM table WHERE regdate BETWEEN {$today} AND {$tomorrow}; $thismonth = mktime(0, 0, 0, date(m), 1, date(Y)); $nextmonth =

[PHP-DB] date format problem

2007-12-22 Thread arafat uddin
my problem is with date format mysql support -mm-dd but my client not use to enter date in -mm-dd format he use to in dd-mm-yyy format how can it possible to input date in dd-mm- format

RE: [PHP-DB] date format problem

2007-12-22 Thread Bastien Koert
www.php.net/date will show you all the possibilities of formatting the date bastien Date: Sat, 22 Dec 2007 17:54:07 +0600 From: [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] date format problem my problem is with date format

Re: [PHP-DB] date problems

2007-09-07 Thread Instruct ICC
From: rDubya [EMAIL PROTECTED] Thanks for the help so far guys!! Not helping though. I have the date contained in the database as timestamp (-MM-DD HH:MM:SS). Do you really need to pull events from the database which are not in your range of interest? This will only slow down your

Re: [PHP-DB] date problems

2007-09-07 Thread Instruct ICC
From: Instruct ICC [EMAIL PROTECTED] And while not trusting your indexing, rewrite short_date as: My short_date rewrite was also wrong. So it looks like you will have to learn those offsets for this function if you do it on the PHP side. But you could also do it on the MySQL side.

Re: [PHP-DB] date problems

2007-09-07 Thread Graham Cossey
This DID work, but I recently switched hosting companies... Is the new server in a different country with a different date format / time zone? Just a thought ;-\ On 9/7/07, Instruct ICC [EMAIL PROTECTED] wrote: From: Instruct ICC [EMAIL PROTECTED] And while not trusting your indexing,

Re: [PHP-DB] date problems

2007-09-07 Thread rDubya
WOW!! Thanks for all the help guys!! And Instruct ICC.. you're solution for pulling the events did work.. but.. it turns out that the solution was actually much simpler than I thought: The old mysql database (once again, not sure what version) stored the date as MMDDHHMMSS. The new

[PHP-DB] date problems

2007-09-06 Thread rDubya
I'm having a problem with dates in php and mysql. I run a site that promotes dated events and concerts and has the information for each stored in a mysql database with the timestamp field. Here is the function that checks the date of the event to ensure it is between now and three weeks from now

RE: [PHP-DB] date problems

2007-09-06 Thread Instruct ICC
From: rDubya [EMAIL PROTECTED] My problem is that I have events dated for Sep 2007 and on, and yet they all come up as being on Dec 7 to 9, 2006.. any ideas? rDubya How about having MySQL only return the events you are interested in? SELECT yourEventFields FROM theTable WHERE TO_DAYS(

Re: [PHP-DB] date problems

2007-09-06 Thread Mike Gohlke
It's much better to use add_date instead of to_days since mysql isn't smart enough to do it for you. Such as: SELECT yourEventFields FROM theTable WHERE theEventDate BETWEEN now() AND date_add(now(), INTERVAL 21 DAYS; This way mysql will calc the now() and date_add and will essentially convert

Re: [PHP-DB] date problems

2007-09-06 Thread Mike Gohlke
Argh, make sure you add the closing paren for the date_add since I forgot it. Mike... Mike Gohlke wrote: It's much better to use add_date instead of to_days since mysql isn't smart enough to do it for you. Such as: SELECT yourEventFields FROM theTable WHERE theEventDate BETWEEN now() AND

Re: [PHP-DB] date problems

2007-09-06 Thread rDubya
Thanks for the help so far guys!! Not helping though. I have the date contained in the database as timestamp (-MM-DD HH:MM:SS). The problem is that not only is it not displaying events, but if I alter my code so that it displays ALL events, it shows the events for the last year, and those

[PHP-DB] DATE

2007-04-06 Thread Ron Piggott
Would someone help me with this --- How do I get the results for 2 days before Easter Sunday from this --- what do I have to do to my date statement to figure out Good Friday? $good_Friday = date(Y-m-d, easter_date($current_year));

Re: [PHP-DB] Date problem

2007-01-21 Thread Miles Thompson
At 12:26 PM 1/21/2007, Denis L. Menezes wrote: Dear friends. I have a date field in mysql called event_end . I want to run a query to find all records where the event_and is greater than today's date. I have written the following code. It does not work. Please point out the mistake. $today =

[PHP-DB] Date Conversion in RFC822 format

2006-05-18 Thread Manoj Singh
Hello all, I am developing a site in php implementing the concept of rss feeds. For that i want to convert the standard date into RFC822 format. If any one have idea about it, please help me. Regards Manoj

Re: [PHP-DB] Date Conversion in RFC822 format

2006-05-18 Thread Stut
Manoj Singh wrote: I am developing a site in php implementing the concept of rss feeds. For that i want to convert the standard date into RFC822 format. If any one have idea about it, please help me. Go to http://php.net/date and search the page for RFC822. If you need further help read the

[PHP-DB] Date Conversion

2006-05-16 Thread Mark Bomgardner
PHP 4.4/MySQL 4.0 I am tying to convert a date to put into a database from a string (ie: January, February) to a numeric value (ie: 01,02). I am taking the value from a form, which is a drop down menu listing the months. $sMonth1 = $_POST['Smonth']; returns the money selected from the form.

RE: [PHP-DB] Date Conversion

2006-05-16 Thread Ralph Brickley
A simple associate array would work as well, although not quite as elegent. $months_arr = array(January=01, February=02...); -Original Message- From: Mark Bomgardner [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 16, 2006 12:35 PM To: Php-Db Subject: [PHP-DB] Date Conversion PHP 4.4/MySQL

RE: [PHP-DB] Date Conversion

2006-05-16 Thread Ralph Brickley
[mailto:[EMAIL PROTECTED] Sent: Tuesday, May 16, 2006 1:29 PM To: [EMAIL PROTECTED]; 'Php-Db' Subject: RE: [PHP-DB] Date Conversion A simple associate array would work as well, although not quite as elegent. $months_arr = array(January=01, February=02...); -Original Message- From: Mark

Re: [PHP-DB] Date question

2006-03-17 Thread Gerry Danen
This works perfect, Bastien! Many thanks. Gerry On 3/13/06, Bastien Koert [EMAIL PROTECTED] wrote: select * from table where date_format(date_field, '%Y-%m') = '2006-02' bastien From: Gerry Danen [EMAIL PROTECTED] To: php-db@lists.php.net CC: [EMAIL PROTECTED] Subject: [PHP-DB] Date

RE: [PHP-DB] Date question

2006-03-13 Thread Bastien Koert
select * from table where date_format(date_field, '%Y-%m') = '2006-02' bastien From: Gerry Danen [EMAIL PROTECTED] To: php-db@lists.php.net CC: [EMAIL PROTECTED] Subject: [PHP-DB] Date question Date: Sun, 12 Mar 2006 20:44:13 -0700 While I am rebuilding my crashed laptop (the machine

[PHP-DB] Date question

2006-03-12 Thread Gerry Danen
While I am rebuilding my crashed laptop (the machine that had all my intelligence), I started thinking about a select statement I need. I have log info in a table and want to extract it on a monthly basis. The date field is in -mm-dd format. What's a good way to select those dates that match

Re: [PHP-DB] Date question

2006-03-12 Thread LJ Regalado
For example, you have table `logs` with `datelog` field and you want to select dates that match 2006-02. You can try this select statement: SELECT * FROM `logs` WHERE MONTH(datelog)='02' and YEAR(datelog)='2006' Hope that helps. LJ Regalado

Re: [PHP-DB] Date question

2006-03-12 Thread Chris
Gerry Danen wrote: While I am rebuilding my crashed laptop (the machine that had all my intelligence), I started thinking about a select statement I need. I have log info in a table and want to extract it on a monthly basis. The date field is in -mm-dd format. What's a good way to select

[PHP-DB] Date Time 90 minutes ago

2006-01-19 Thread Ron Piggott (PHP)
Would someone be able to help me with the DATE command syntax to know what the date and time was 90 minutes ago? I am trying to assign these values into two variables: $date_90_minutes_ago $time_90_minutes_ago I am not sure how to handle midnight where if the time is 00:10:00 ninety minutes

RE: [PHP-DB] Date Time 90 minutes ago

2006-01-19 Thread Bastien Koert
?php echo date(Y-m-d H:i:s,strtotime(90 minutes ago)); ? bastien From: Ron Piggott (PHP) [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: PHP DB php-db@lists.php.net Subject: [PHP-DB] Date Time 90 minutes ago Date: Thu, 19 Jan 2006 16:57:33 -0500 Would someone be able to help me

Re: [PHP-DB] Date Time 90 minutes ago

2006-01-19 Thread Cal Evans
$date_90_minutes_ago = date('m/d/Y',mktime()-(60*90)); $time_90_minutes_ago = date('h:i:s',mktime()-(60*90)); 60 seconds * 90 minutes. =C= | | Cal Evans | http://www.calevans.com | | We get our best customers from referrals. | We would appreciate you referring any of your | friends or co-workers

RE: [PHP-DB] Date Time 90 minutes ago

2006-01-19 Thread tg-php
-d H:i:s,strtotime(90 minutes ago)); ? bastien From: Ron Piggott (PHP) [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: PHP DB php-db@lists.php.net Subject: [PHP-DB] Date Time 90 minutes ago Date: Thu, 19 Jan 2006 16:57:33 -0500 Would someone be able to help me with the DATE command syntax

[PHP-DB] Date Formatting Question

2005-12-14 Thread Bomgardner, Mark A
I am trying to format the month portion of a date that I am trying to pull from MySQL to be placed into a drop down menu to modify the date. I have tried several ways and none seem to be working. I am pulling the date out of MySQL with: $sDate = explode(-, $row_events['Sdate']); And then

Re: [PHP-DB] Date Formatting Question

2005-12-14 Thread tg-php
You got the right idea, but you're making it more complicated than it needs to be. your $sDate after using explode() is going to contain an array. strtotime doesn't take an array, it takes a string. $monthName = date(F, strtotime($row_events['Sdate'])); $monthNumber = date(m,

[PHP-DB] DATE(r)

2005-09-09 Thread Ron Piggott
Question: I am trying to for the first time create a table with a column that is defined as datetime I wanted to populate that column with the date(r) command. date(r) on my web site gives this response: Fri, 9 Sep 2005 13:32:19 -0400 How may I manipulate date(r) to give a format which is

RE: [PHP-DB] DATE(r)

2005-09-09 Thread Bastien Koert
use timestamp column type and populate it by $date = strtottime(date(r)); then when you want to display it $date = date('r',$row['datefieldname']); Bastien From: Ron Piggott [EMAIL PROTECTED] Reply-To: Ron Piggott [EMAIL PROTECTED] To: PHP DB php-db@lists.php.net Subject: [PHP-DB] DATE(r

Re: [PHP-DB] DATE(r)

2005-09-09 Thread Jordan Miller
You need to use: date('Y-m-d H:i:s'); It's in the comments at: http://www.php.net/date Jordan On Sep 9, 2005, at 12:52 PM, Ron Piggott wrote: Question: I am trying to for the first time create a table with a column that is defined as datetime I wanted to populate that column with the

[PHP-DB] Date problem again ;-)

2005-03-22 Thread Chris Payne
Hi there everyone, OK I'm using the following in my query to display entries in the LAST 3 days: DATE_SUB(CURDATE(),INTERVAL 3 DAY) = ListingDate But it doesn't seem to affect the results, the date format in my DB column (ListingDate - datatype is Date) is 2000-00-00 as in year, month

Re: [PHP-DB] Date problem again ;-)

2005-03-22 Thread Forest Liu
I suppose there is a submit_time field in your DB table, so you could: SELECT * FROM `tablename` WHERE `submit_time`=.lastdays(3) lastdays() is a function you could create using mktime(),time(), and date() On Tue, 22 Mar 2005 16:28:39 -0500, Chris Payne [EMAIL PROTECTED] wrote: Hi there

RE: [PHP-DB] date conversions

2004-12-16 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 16 December 2004 06:00, neil wrote: Hi I am needing to convert a d/m/y date such as 30/11/2004 into the format that mysql can use ie. 2004-11-20 If I try the following:

[PHP-DB] date conversions

2004-12-15 Thread neil
Hi I am needing to convert a d/m/y date such as 30/11/2004 into the format that mysql can use ie. 2004-11-20 If I try the following: $testdate=30/11/2004; echo date(Y-m-d, strtotime($testdate)); the result is - 2006-06-11 I can't find any other function apart from strtotime to do this. Any

Re: [PHP-DB] date conversions

2004-12-15 Thread Jason Wong
On Thursday 16 December 2004 14:00, neil wrote: I am needing to convert a d/m/y date such as 30/11/2004 into the format that mysql can use ie. 2004-11-20 If I try the following: $testdate=30/11/2004; echo date(Y-m-d, strtotime($testdate)); the result is - 2006-06-11 I can't find any

Re: [PHP-DB] date conversions

2004-12-15 Thread neil
Thank you for all your help. Among all the variations I found this to be the clearest: list($d,$m,$y) = explode(/,$testdate); $mysqldate = date(Y-m-d, mktime(0,0,0,$m,$d,$y)); But I also thought the use of split instead of explode so you could nominate multiple delimiters was good. eg.

[PHP-DB] Date Question

2004-10-27 Thread Bomgardner, Mark A
I am having trouble converting a date from mm/dd/ to -mm-dd on a user form. I know there was post about this, but I keep getting an error message when I try to search the archives. I have looked at the manual, but I am not finding what I am looking for. Mark A. Bomgardner

RE: [PHP-DB] Date Question

2004-10-27 Thread Bastien Koert
How are you trying to convert the date? bastien From: Bomgardner, Mark A [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] Date Question Date: Wed, 27 Oct 2004 11:17:16 -0500 I am having trouble converting a date from mm/dd/ to -mm-dd on a user form. I know there was post about

Re: [PHP-DB] Date Question

2004-10-27 Thread John Holmes
Bomgardner, Mark A wrote: I am having trouble converting a date from mm/dd/ to -mm-dd on a user form. I know there was post about this, but I keep getting an error message when I try to search the archives. I have looked at the manual, but I am not finding what I am looking for. echo

[PHP-DB] Date Conversion

2004-08-18 Thread Ng Hwee Hwee
Hi all, can someone kindly point me to a resource that converts all kinds of possible date inputs into MySQL format of -MM-DD? example of formats to be converted includes: d/m/yy d/m/ d/mm/yy d/mm/yyy dd/mm/yy dd/mm/yyy d/mmm/yy d/mmm/ dd/mmm/yy dd/mmm/ yy - 2 digit

RE: [PHP-DB] Date problem: data is current as of yesterday

2004-07-03 Thread Ford, Mike [LSS]
-Original Message- From: Karen Resplendo To: [EMAIL PROTECTED] Sent: 02/07/04 19:36 Subject: [PHP-DB] Date problem: data is current as of yesterday The database queries all the sources at night after everyone has gone home. That means the data was current as of yesterday. This little

[PHP-DB] Date problem: data is current as of yesterday

2004-07-02 Thread Karen Resplendo
The database queries all the sources at night after everyone has gone home. That means the data was current as of yesterday. This little snippet below returns yesterday's date, except that the first day of the month returns 0 for the day. Now, I know why this is happening, but I can't find out

Re: [PHP-DB] Date problem: data is current as of yesterday

2004-07-02 Thread jeffrey_n_Dyke
accidentally replied only to karen. The database queries all the sources at night after everyone has gone home. That means the data was current as of yesterday. This little snippet below returns yesterday's date, except that the first day of the month returns 0 for the day. Now, I know why

[PHP-DB] Date Select

2004-06-25 Thread Tom Chubb
How can I query a MySQL table to get the latest results from a date field? Basically, I am inserting several records at a time at the end of each week. I want to have a page that displays the results for the last week only. The date format in the field is -MM-DD

Re: [PHP-DB] Date Select

2004-06-25 Thread jeffrey_n_Dyke
How can I query a MySQL table to get the latest results from a date field? Basically, I am inserting several records at a time at the end of each week. I want to have a page that displays the results for the last week only. The date format in the field is -MM-DD if you want the latest row

RE: [PHP-DB] Date Select

2004-06-25 Thread Tom Chubb
] [mailto:[EMAIL PROTECTED] Sent: 25 June 2004 12:15 To: Tom Chubb Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Date Select How can I query a MySQL table to get the latest results from a date field? Basically, I am inserting several records at a time at the end of each week. I want

Re: [PHP-DB] Date help needed

2004-06-25 Thread Neil Smith [MVP, Digital media]
Content-Transfer-Encoding: 7bit Subject: RE: [PHP-DB] Date help needed One thing he wanted which I didn't know how to do (Javascript I guess which I don't know much about) was to preload a database of email address, and as he started to type an email address it would do a sort of auto-complete

[PHP-DB] Date help needed

2004-06-24 Thread Chris Payne
Hi there everyone, I have a problem, I currently have some code which populates a dropdown box - this code gives me every day for the next x amount of days (EG: a years worth of days), however what I really need to be able to do, is to find a way to display this data in the dropdown box but

Re: [PHP-DB] Date help needed

2004-06-24 Thread Justin Patrin
You could loop through the weeks and put those 3 specifically in: $days = array(); for($i = 0; $i 365; $i +=7) { $days[] = strtotime('next Monday', strtotime('+ '.$i.' days')); $days[] = strtotime('next Friday', strtotime('+ '.$i.' days')); $days[] = strtotime('next Sunday', strtotime('+

RE: [PHP-DB] Date help needed

2004-06-24 Thread Chris Payne
Hi there, Just got back and tried it and it works perfectly, thank you so much for your help, you've got me out of a bind here ;-) Chris You could loop through the weeks and put those 3 specifically in: $days = array(); for($i = 0; $i 365; $i +=7) { $days[] = strtotime('next Monday',

Re: [PHP-DB] Date help needed

2004-06-24 Thread Daniel Clark
A drop down with 365 days !?!? Isn't that a little big? I have a problem, I currently have some code which populates a dropdown box - this code gives me every day for the next x amount of days (EG: a years worth of days), however what I really need to be able to do, is to find a way to

RE: [PHP-DB] Date help needed

2004-06-24 Thread Chris Payne
Hi there, A drop down with 365 days !?!? Isn't that a little big? Actually it's Fridays, Sundays and Tuesdays for 2 years (365 was an example) it's for an Admin for a client, and he asked that it be in a dropdown box and he's the boss, so he gets what he wants :-) One thing he wanted which I

[PHP-DB] date and time problem

2004-05-14 Thread Kim Jacobs - MWEB
Hi guys I have a script which pulls a date(date default NULL) and a time (time default NULL) from a MySQL database, now I would like to display that date and time in a 'pretty' format. I've been able to show the date nicely with the help of this:

[PHP-DB] Date SELECT with IF

2004-04-15 Thread Shaun
Hi, Is it possible to have a clause in a mysql SELECT statement? I would the query to display the date except where it equals the default 000-00-00 to display n/a or something similar. For example SELECT DATE_FORMAT(B.Booking_End_Date, \%Y-%m-%d\) AS 'Booking End Date' FROM Bookings (IF

Re: [PHP-DB] Date SELECT with IF

2004-04-15 Thread Ignatius Reilly
: Thursday, April 15, 2004 7:44 PM Subject: [PHP-DB] Date SELECT with IF Hi, Is it possible to have a clause in a mysql SELECT statement? I would the query to display the date except where it equals the default 000-00-00 to display n/a or something similar. For example SELECT DATE_FORMAT

Re: [PHP-DB] Date SELECT with IF

2004-04-15 Thread Marcjon Louwersheimer
try the WHERE clause. SELECT name, address, phone, date FROM usertable WHERE date = '-00-00' And please, look at the mysql documentation, or at least the tutorial. -- Marcjon -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Date Manipulation

2004-03-21 Thread Shannon Doyle
Hi People, Need some assistance in the following scenario:- Inserting a date into the database that is entered into a form by the site visitor. - This is easy enough. However I now need to use the same date that has been entered by the site visitor add 35 days and then insert into another

Re: [PHP-DB] Date Manipulation

2004-03-21 Thread John W. Holmes
Shannon Doyle wrote: My question, how do I get the date entered into the form add 35days to it and then include that into the same sql query as the first one. Or do I have to use a second sql query? If the second query how would I get the date and add 35days?? INSERT INTO table (date1, date2)

[PHP-DB] date problem in MySQL DB

2004-01-13 Thread Angelo Zanetti
Hi guys This might be slightly off topic but hopefully someone can help. I have a field that is a varchar and I stored dates in it. But now I want to change the type of the column to date, but I have a problem that the formats differ: my format: mm/dd/ mySQL format: -mm-dd So can I

Re: [PHP-DB] date problem in MySQL DB

2004-01-13 Thread CPT John W. Holmes
From: Angelo Zanetti [EMAIL PROTECTED] This might be slightly off topic but hopefully someone can help. I have a field that is a varchar and I stored dates in it. But now I want to change the type of the column to date, but I have a problem that the formats differ: my format: mm/dd/

RE: [PHP-DB] date problem in MySQL DB

2004-01-13 Thread brett king
Hi Angelo Yes you will have to reformat and he is something that may help you. Hope it does function dateCheckMysql ($date) { list($dateDay, $dateMonth, $dateYear) = explode(/, $date); if ((is_numeric($dateDay)) (is_numeric($dateMonth))

Re: [PHP-DB] date problem in MySQL DB

2004-01-13 Thread Justin Patrin
Brett King wrote: Hi Angelo Yes you will have to reformat and he is something that may help you. Hope it does function dateCheckMysql ($date) { list($dateDay, $dateMonth, $dateYear) = explode(/, $date); if ((is_numeric($dateDay)) (is_numeric($dateMonth))

[PHP-DB] date function

2003-11-02 Thread OpenSource
Hi guys, This might not be the best place for this but here goes. I want to create a dropdown list with a date range of -- SELECT name=bdate OPTION value=11/02/2003 SELECTEDToday OPTION value=11/01/2003Yesterday OPTION

Re: [PHP-DB] date function

2003-11-02 Thread Larry E . Ullman
This might not be the best place for this but here goes. You are correct. At the very least, you should probably be using the general PHP list, not the database one. I want to create a dropdown list with a date range of Not to be obstinate, but it looks like you already have. But, assuming

Re: [PHP-DB] date function

2003-11-02 Thread Ignatius Reilly
have a look at the PEAR date package. http://pear.php.net/package/Date _ - Original Message - From: OpenSource [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, November 02, 2003 11:13 PM Subject: [PHP-DB] date function Hi guys, This might not be the best

Re: [PHP-DB] date function

2003-11-02 Thread Martin Marques
1) Why do you send this to a DB list? 2) Try seeing the Date class of PEAR (PEAR::Date). El Dom 02 Nov 2003 19:13, OpenSource escribió: Hi guys, This might not be the best place for this but here goes. I want to create a dropdown list with a date range of

[PHP-DB] Date Pulldown

2003-11-02 Thread Peter Westergaard
Sorry for what is probably going to be a late reply. I'm waiting to pick someone up at the airport, and the plane was delayed, so I wanted to try my hand at answering your question. First I had to figure out what method you used to pick those dates in the first place. It seems to be...

[PHP-DB] date function

2003-09-05 Thread Darryl
Greetings, I have some php code that pulls from the mysql database. Here it is: ?php mysql_connect(wildcat.osborneindustries.com, webuser, webpass); $mymonth = date('n'); $cyear = date('Y'); $query = SELECT name,hdate FROM emp2 where month(hdate)=$mymonth order by hdate;

Re: [PHP-DB] date function

2003-09-05 Thread Jason Wong
On Saturday 06 September 2003 06:01, Darryl wrote: I have some php code that pulls from the mysql database. Here it is: ?php mysql_connect(wildcat.osborneindustries.com, webuser, webpass); $mymonth = date('n'); $cyear = date('Y'); $query = SELECT name,hdate FROM

[PHP-DB] Date format problem

2003-08-14 Thread Dani Matielo
Hello, I have a field in my mysql db wich is a timestamp with the format mmddhhmmss and I would like to display it like: dd/mm/ how do I do that? Thank you in advance, Dani --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com).

RE: [PHP-DB] Date format problem

2003-08-14 Thread Jennifer Goodie
I have a field in my mysql db wich is a timestamp with the format mmddhhmmss and I would like to display it like: dd/mm/ http://www.mysql.com/doc/en/Date_and_time_functions.html#IDX1333 SELECT DATE_FORMAT(timestamp_col_name, '%d/%m/%Y') FROM table_name -- PHP Database

[PHP-DB] Date problem

2003-07-14 Thread Chris Payne
Hi there everyone, I use the below code to grab the current date, convert it to a unix timestamp to do some bits then it's supposed to change the date back with the new values (IE: current date - x amount of seconds) but it's not doing it correctly, it's probably DEAD obvious to everyone as my

RE: [PHP-DB] Date problem

2003-07-14 Thread Gary . Every
Pay It Forward mailto:[EMAIL PROTECTED] http://accessingram.com -Original Message- From: Chris Payne [mailto:[EMAIL PROTECTED] Sent: Monday, July 14, 2003 3:45 AM To: php Subject: [PHP-DB] Date problem Hi there everyone, I use the below code to grab the current date, convert

[PHP-DB] date, and time?

2003-07-10 Thread Tristan . Pretty
Cheers for the help on my last auto inc prob.. I checked out phpmyadmin, and I'm loving it...! cheers all Anyway, I want to know how to store a date like this in a MySQL database: date(F j, Y, g:i a); Resulting in: July 10, 2003, 3:39 am But what do I need to set my

Re: [PHP-DB] date, and time?

2003-07-10 Thread jeffrey_n_Dyke
] cc: 07/10/2003 11:02 AM Subject: [PHP-DB] date, and time

[PHP-DB] Date Formatting in PHP

2003-06-10 Thread David Shugarts
I have a simple need to reformat a variable coming in as $DatePick, brought forward from a MySQL select in the format: 2003-11-18 I need to convert it to the format November 18, 2003 I am trying to avoid having to mess with the MySQL select statement, as the output is being passed

Re: [PHP-DB] Date Formatting in PHP

2003-06-10 Thread Frank Keessen
PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 11:23 PM Subject: [PHP-DB] Date Formatting in PHP I have a simple need to reformat a variable coming in as $DatePick, brought forward from a MySQL select in the format: 2003-11-18 I need to convert it to the format November

Re: [PHP-DB] Date Formatting in PHP

2003-06-10 Thread John R Wunderly
At 05:23 PM 6/10/2003 -0400, David Shugarts wrote: I have a simple need to reformat a variable coming in as $DatePick, brought forward from a MySQL select in the format: 2003-11-18 I need to convert it to the format November 18, 2003 try the dice-n-slice method. use substr and

Re: [PHP-DB] Date Formatting in PHP

2003-06-10 Thread CPT John W. Holmes
I have a simple need to reformat a variable coming in as $DatePick, brought forward from a MySQL select in the format: 2003-11-18 I need to convert it to the format November 18, 2003 $f_date = date('F d, Y',strtotime($db_date)); ---John Holmes... -- PHP Database Mailing List

Re: [PHP-DB] Date Formatting in PHP

2003-06-10 Thread David Shugarts
This worked perfectly, is very simple for me to use, and I would never have come upon it in 10,000 years of trying. Thanks! Thanks also to everyone who offered ideas. $f_date = date('F d, Y',strtotime($db_date)); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP-DB] date to Y-M-D

2003-03-25 Thread David Rice
a function to convert any date to ymd... function datetoymd($date){ $dateymd = date('Y-m-d',$date); return $dateymd; } this function when output gives me the date 1970-01-01 (date of the unix timestamp start) so, ehm, why!? cheers, dave

Re: [PHP-DB] date to Y-M-D

2003-03-25 Thread CPT John W. Holmes
function datetoymd($date){ $dateymd = date('Y-m-d',$date); return $dateymd; } this function when output gives me the date 1970-01-01 (date of the unix timestamp start) so, ehm, why!? Because you're not passing a valid Unix timestamp or whatever your passing is empty. ---John Holmes...

RE: [PHP-DB] date to Y-M-D

2003-03-25 Thread Snijders, Mark
] Verzonden: Tuesday, March 25, 2003 3:42 PM Aan: [EMAIL PROTECTED] Onderwerp: [PHP-DB] date to Y-M-D a function to convert any date to ymd... function datetoymd($date){ $dateymd = date('Y-m-d',$date); return $dateymd; } this function when output gives me the date 1970-01-01 (date

[PHP-DB] Date in a dropbox box

2003-03-10 Thread Chris Payne
Hi there everyone, I have a form which displays 3 dropdowns, day, month and year, I have it displaying the default of the dropdown for month no problem, but how can I get it to select the current date (day) in the dropdown, but show 31 days nomatter how many days are in the month? This is

RE: [PHP-DB] Date in a dropbox box

2003-03-10 Thread John W. Holmes
I have a form which displays 3 dropdowns, day, month and year, I have it displaying the default of the dropdown for month no problem, but how can I get it to select the current date (day) in the dropdown, but show 31 days nomatter how many days are in the month? This is important even though

Re: [PHP-DB] Date in a dropbox box

2003-03-10 Thread Chris Payne
Hi there, Thank you John, you are a lifesaver :-) Chris I have a form which displays 3 dropdowns, day, month and year, I have it displaying the default of the dropdown for month no problem, but how can I get it to select the current date (day) in the dropdown, but show 31 days

Re: [PHP-DB] date functions (generates parse error)

2003-03-05 Thread David Rice
Sorry, I forgot to add the part at the bottom where I am calling the function = ? function tips($weekstart){ $start = date('Ymd',strtotime($weekstart));   $query = SELECT * FROM Rota WHERE date = $start and date = ($start +

RE: [PHP-DB] date functions (generates parse error)

2003-03-05 Thread John W. Holmes
Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: David Rice [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2003 12:34 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP-DB] date functions (generates parse error) Sorry, I forgot

[PHP-DB] date functions

2003-03-04 Thread David Rice
I am looking for a way to take a date stored in a mysql database... and find out the date seven days later. how would i do this?! cheers, dave _ Chat online in real time with MSN Messenger http://messenger.msn.co.uk -- PHP

  1   2   3   >