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 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 = 0; $counter < mysql_n

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

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

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

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

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-12 Thread Jürgen Wind
you can mimic the old behaviour like so: select TS, 1*TS as OldStyle; (TS being your timestamp filed) TS |OldStyle 2007-09-03 15:03:02 | 20070903150302 rDubya wrote: > > WOW!! Thanks for all the help guys!! And Instruct ICC.. you're > solution for pulling the events did work.. but.. i

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 databas

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 index

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

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 up

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 date

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

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 =

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 r

RE: [PHP-DB] Date Conversion

2006-05-16 Thread Ralph Brickley
ph Brickley -Original Message- From: 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 = ar

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/

Re: [PHP-DB] Date Conversion

2006-05-16 Thread Brad Bonkoski
Mark Bomgardner wrote: 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 mon

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

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 tha

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 tho

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 & Time 90 minutes ago

2006-01-19 Thread tg-php
Bastien's example is probably the quickest and easiest. I just wanted to point out that you can use math within the mktime() function as well in case the relative date/time you need isn't "right now". $month = 1; $day = 19; $year = 2006; $hour = 17; $minute = 08; $second = 05; echo date("Y-m-d

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 Bastien Koert
bastien From: "Ron Piggott (PHP)" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: PHP DB 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 to know what the date and time was 90 minutes ago? I

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", strtotime($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 dat

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" Subject: [PHP-DB] DATE(r) Date: Fri,

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 ther

Re: [PHP-DB] date conversions

2004-12-16 Thread tg-php
Interesting use of split().. don't think I've ever used that function but looks like it'll do just as well and also allow multiple dividers. Thanks for pointing that out. As for this: $mysqldate = $y.'-'.$m.'-'.$d; The only problem I foresee is what happens when you have single digit days an

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 follow

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

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

Re: [PHP-DB] date conversions

2004-12-15 Thread tg-php
Yeah, this is my problem with relyinig on strtotime(). If you don't give it a format that it knows, it's going to give you random results (well, not random, but "undesireable"). Seems like more of a crutch that leaves too much chance of error for my taste. I prefer to be a little more explici

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

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 ab

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 snipp

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

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

2004-07-02 Thread Neal Carmine
Use strtotime() instead.. http://us2.php.net/manual/en/function.strtotime.php Regards, Neal Carmine Nine Systems Corporation -Original Message- From: Karen Resplendo [mailto:[EMAIL PROTECTED] Sent: Friday, July 02, 2004 12:36 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Date problem: dat

RE: [PHP-DB] Date help needed

2004-06-25 Thread Kenny
Hi Neil, I would actually like to get a sample of this code as well if you don't mind K- -Original Message- From: Neil Smith [MVP, Digital media] [mailto:[EMAIL PROTECTED] Sent: 25 June 2004 16:22 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Date help neede

Re: [PHP-DB] Date help needed

2004-06-25 Thread Neil Smith [MVP, Digital media]
0 Content-Type: text/plain; charset="us-ascii" 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

RE: [PHP-DB] Date Select

2004-06-25 Thread Tom Chubb
EMAIL PROTECTED] [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

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

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

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

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', strtoti

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 and time problem

2004-05-15 Thread Bruno Ferreira
Kim Jacobs - MWEB wrote: 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: $ntime=strtotime(

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

Re: [PHP-DB] Date SELECT with IF

2004-04-15 Thread Ignatius Reilly
SELECT IF( B.Booking_End_Date != "-00-00", DATE_FORMAT( B.Booking_End_Date, "%Y-%m-%d" ), "N/A" ) AS Booking_End_Date FROM Bookings AS B, etc. HTH Ignatius _ - Original Message - From: "Shaun" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> S

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

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

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)) && (is_numer

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

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 be

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 t

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: > > mysql_connect("wildcat.osborneindustries.com", "webuser", > "webpass"); >$mymonth = date('n'); >$cyear = date('Y'); > $query = "SELECT name,hdat

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 Datab

RE: [PHP-DB] Date problem

2003-07-14 Thread Gary . Every
> // Do some number crunching here // > > $newnow = $now-$numweeks; > > echo $now; > > $converted_date = date("d-m-y",$now); > > echo "$converted_date"; You should be running your $convewrted_date on $newnow, not $now Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876

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

2003-07-10 Thread jeffrey_n_Dyke
you could change mysql to a few different date formats, but i don't _think_ that is one of them. Why not just take care of a format change on the way out with DATE_FORMAT. Also, if you store the date as one of the defualt date[time] values then you have tons of functions that you can run against

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

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

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 concat

Re: [PHP-DB] Date Formatting in PHP

2003-06-10 Thread Frank Keessen
Hi David, Try this one: Regards, Frank - Original Message - From: "David Shugarts" <[EMAIL 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, b

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

2003-03-25 Thread Snijders, Mark
ehmmm what kind of dates do you use, maybe dates of birth? when using date of unix timestamp you can't have dates befor 1970 so if those timestamps represents an older date you can't use timestamps! -mark- -Oorspronkelijk bericht- Van: David Rice [mailto:[EMAIL PROTECTED] Verzonden

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 Holme

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

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

2003-03-05 Thread John W. Holmes
t - A monthly magazine for PHP 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 funct

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 = $start = date('Ymd',strtotime($weekstart));   $query = "SELECT * FROM Rota WHERE date >= $start and date <= ($start + INTERVAL 6 DAY) ORDER BY staff

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

2003-03-04 Thread 1LT John W. Holmes
> Here is the whole code of my function > > Whenever i run it, it say's there is a parse error on line 6, can't see what > is the problem > the format of $weekstart (as it is stored in the Database) is -MM-DD > > = > function tips

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

2003-03-04 Thread David Rice
Here is the whole code of my function Whenever i run it, it say's there is a parse error on line 6, can't see what is the problem the format of $weekstart (as it is stored in the Database) is -MM-DD = $start = date('Ymd',strto

Re: [PHP-DB] date functions

2003-03-04 Thread 1LT John W. Holmes
> I want to use it in this function that i am creating (it's for a resteraunt > automated tips system, to work out how much tips each staff member is > entitled to. > > > function tips($weekstart){ > /* JUST BELOW HERE IS WHER

RE: [PHP-DB] date functions

2003-03-04 Thread Hutchins, Richard
Good stuff here. http://www.mysql.com/doc/en/Date_and_time_functions.html Check out the SELECT DATE_ADD section. That might be what you're looking for. HTH, Rich > -Original Message- > From: David Rice [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 04, 2003 9:36 AM > To: [EMAIL PROTEC

Re: [PHP-DB] date functions

2003-03-04 Thread 1LT John W. Holmes
> 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?! too easy... SELECT date_column + INTERVAL 7 DAY FROM your_table ... ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, vi

RE: [PHP-DB] Date

2003-02-28 Thread Snijders, Mark
go to mysql.com en look for date -Original Message- From: Jorge Miguel Fonseca Martins [mailto:[EMAIL PROTECTED] Sent: vrijdag 28 februari 2003 16:23 To: [EMAIL PROTECTED] Subject: [PHP-DB] Date How can a make a query that lists all the fields where a datefield as the date of tomorow?

RE: [PHP-DB] Date Range Question...

2003-02-04 Thread NIPP, SCOTT V (SBCSI)
t the difference of 2 or 3 days? -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 10:04 AM To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED] Subject: Re: [PHP-DB] Date Range Question... > I am working on an app that needs to post informat

Re: [PHP-DB] Date Range Question...

2003-02-04 Thread 1LT John W. Holmes
> I am working on an app that needs to post information to a website > based on date. The tricky part for me is that the date is a range that > spans either 2 or 3 days. I want the web page to dynamically populate this > information based on a query. The query will look something like this: > my

RE: [PHP-DB] date: reverse order

2003-02-04 Thread Addison Ellis
thank you... this worked. best, addison Simple MySQL. After your ORDER BY clause use either ASC (I think this is the default) or DESC. I'm pretty sure this'll work on date fields to produce the results you want. Your query will end up looking like: "...order by createdate DESC" -Original

RE: [PHP-DB] date: reverse order

2003-02-04 Thread Hutchins, Richard
Simple MySQL. After your ORDER BY clause use either ASC (I think this is the default) or DESC. I'm pretty sure this'll work on date fields to produce the results you want. Your query will end up looking like: "...order by createdate DESC" > -Original Message- > From: Addison Ellis [mailt

Re: [PHP-DB] date: reverse order

2003-02-04 Thread 1LT John W. Holmes
> when retrieving data from the db and displaying it on the > page by creation date how can i reverse the order so that the most > recent entry appears first? here's what i have now: > > require("config.php"); > > $obj = mysql_db_query($dbname,"select * from ads order by createdate"); > ?

Re: [PHP-DB] Date format in MySQL

2003-02-03 Thread Adam Voigt
$query = mysql_query("SELECT UNIX_TIMESTAMP(fieldname) AS date WHERE id = '1';"); $array = mysql_fetch_array($query); $mydate = date("j F, Y",$array[date]); Change fieldname and the where clause, and that should work. If you want to further munipulate how it looks, just look at the dat

Re: [PHP-DB] Date format in MySQL

2003-02-03 Thread Jeffrey_N_Dyke
ewson s.utk.edu>cc: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> Subjec

Re: [PHP-DB] Date format in MySQL

2003-02-03 Thread John Krewson
strftime() offers a lot of formatting options for dates. Hope it helps. RUBANOWICZ Lisa wrote: Hi All, I have a date format of -MM-DD in MySQL and am showing it on a PHP page. However I want to show it as "2 February, 2003" or "2 February" Can someone please help me. The date will not ne

Re: [PHP-DB] Date math functions...

2003-01-15 Thread 1LT John W. Holmes
> > > mysql("$DBName","UPDATE Balances SET CompEarned=CompTaken+8 WHERE > > > said='$said'") or die(mysql_error()); > > > mysql("$DBName","INSERT INTO Log VALUES(DATE_ADD($StopDate, > > > INTERVAL 1 DAY,'',1,2,'$CalendarDetailsID')") or die(mysql_error()); > Actually this is generating another err

Re: [PHP-DB] Date math functions...

2003-01-15 Thread Jason Wong
On Thursday 16 January 2003 00:55, NIPP, SCOTT V (SBCSI) wrote: > Actually this is generating another error. Now, without the single > quotes I am getting the following error: > > Column 'StartDate' cannot be null > > It looks like for some reason the DATE_ADD is returning a NULL > val

RE: [PHP-DB] Date math functions...

2003-01-15 Thread NIPP, SCOTT V (SBCSI)
: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 15, 2003 10:32 AM To: 1LT John W. Holmes; NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED] Subject: Re: [PHP-DB] Date math functions... > [snip] > > if ($dateDiff == 3) { > > mysql("$DBName","UPDATE B

RE: [PHP-DB] Date math functions...

2003-01-15 Thread NIPP, SCOTT V (SBCSI)
] Subject: Re: [PHP-DB] Date math functions... > [snip] > > if ($dateDiff == 3) { > > mysql("$DBName","UPDATE Balances SET CompEarned=CompTaken+8 WHERE > > said='$said'") or die(mysql_error()); > > mysql("$DBName","INSERT INTO Log VA

Re: [PHP-DB] Date math functions...

2003-01-15 Thread 1LT John W. Holmes
> [snip] > > if ($dateDiff == 3) { > > mysql("$DBName","UPDATE Balances SET CompEarned=CompTaken+8 WHERE > > said='$said'") or die(mysql_error()); > > mysql("$DBName","INSERT INTO Log VALUES('DATE_ADD($StopDate, > > INTERVAL 1 DAY','',1,2,'$CalendarDetailsID')") or die(mysql_error()); > > > > My bi

Re: [PHP-DB] Date math functions...

2003-01-15 Thread 1LT John W. Holmes
[snip] > if ($dateDiff == 3) { > mysql("$DBName","UPDATE Balances SET CompEarned=CompTaken+8 WHERE > said='$said'") or die(mysql_error()); > mysql("$DBName","INSERT INTO Log VALUES('DATE_ADD($StopDate, > INTERVAL 1 DAY','',1,2,'$CalendarDetailsID')") or die(mysql_error()); > > My big question is ab

Re: [PHP-DB] Date Question

2002-11-29 Thread Jason Wong
On Saturday 30 November 2002 12:30, Chris Payne wrote: > Hi there everyone, > > I've never really used the date functions beyond getting it to store the > current date in a db. > > I have a dilema in that I need to get all the days in the current month and > all the days in the next month (whatever

RE: [PHP-DB] date()

2002-11-18 Thread Jeffrey_N_Dyke
@Keane.com To: "'Edward Peloke'" <[EMAIL PROTECTED]> cc: "'Php-Db'" <[EMAIL PROTECTED]>

RE: [PHP-DB] date()

2002-11-18 Thread Jeffrey_N_Dyke
toredDate) as date FROM SomeTable where blah blah" Should work like that? Aaron -Original Message- From: Edward Peloke [mailto:[EMAIL PROTECTED]] Sent: November 18, 2002 2:50 PM To: 'Php-Db' Subject: RE: [PHP-DB] date() it is just a datetime field and the clients use a ja

Re: [PHP-DB] date()

2002-11-18 Thread Jason Wong
On Tuesday 19 November 2002 03:26, Aaron Wolski wrote: > Hmm.. I would get it into a unix_timestamp (unless someone can suggest a > reasoning for now doing so). It really depends on where you want to manipulate the dates. If mostly from within MySQL then store with DATE, DATETIME & TIMESTAMP, if

RE: [PHP-DB] date()

2002-11-18 Thread Aaron Wolski
Sent: November 18, 2002 2:50 PM To: 'Php-Db' Subject: RE: [PHP-DB] date() it is just a datetime field and the clients use a javascript calander to pick the date, here is the exact date as it appears in the db. 2002-11-08 00:00:00 Eddie -Original Message- From: Aaron Wolski [mailto:[

RE: [PHP-DB] date()

2002-11-18 Thread Edward Peloke
eloke'; 'Php-Db' Subject: RE: [PHP-DB] date() Ok.. I guess it depends on how your date is stored. I always use unix_timestamps. If you are too.. then the format I supplied should work as indicated. Aaron -Original Message- From: Edward Peloke [mailto:[EMAIL PROTECTED]] Sen

  1   2   >