[PHP] Date Question

2006-03-17 Thread Tom Chubb
Please can you help me. I've created a page where problems are posted into a database and I am using the datetime format in MySQL and trying to find the best way to display it in the 17/03/06 format. I've found a way of doing it (so you don't think I haven't googled, RTFM) but don't think it's the

Re: [PHP] Date Question

2006-03-17 Thread Pure Web Solution
Hi How about doing this in the query string you send to mysql: DATE_FORMAT(fieldname, '%d %m %y') this way you wont have to mess around with the array stuff. for more info look here http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html Regards Pure Web Solution

Re: [PHP] Date Question

2006-03-17 Thread adriano ghezzi
on the fly: use date_format function in select statement, format should be a string like %d%m%y not sure about it check on manual. hth adriano 2006/3/17, Tom Chubb [EMAIL PROTECTED]: Please can you help me. I've created a page where problems are posted into a database and I am using the

[PHP] Date question

2006-02-24 Thread William Stokes
Hello, I have a datetime column in MySQL DB. How can I match to that column from php code if I only have the date information available. 2006-02-24 12:00:00 against2006-02-24 This might be more SQL question sorry about that. Thanks -Will -- PHP General Mailing List

Re: [PHP] Date question

2006-02-24 Thread ÃmìtVërmå
If you are only avail with date-information then too you can use existing DATETIME field as following query.. INSERT INTO `test` (`testingdate` ) VALUES ( '2006-06-06'); it will take care of itself. Second way is you can change DATETIME field to VARCHAR (if you're not going to use those

Re: [PHP] Date question

2006-02-24 Thread Sumeet
William Stokes wrote: Hello, I have a datetime column in MySQL DB. How can I match to that column from php code if I only have the date information available. 2006-02-24 12:00:00 against2006-02-24 This might be more SQL question sorry about that. Thanks -Will use

Re: [PHP] Date question

2006-02-24 Thread Chris Boget
I have a datetime column in MySQL DB. How can I match to that column from php code if I only have the date information available. 2006-02-24 12:00:00 against2006-02-24 This might be more SQL question sorry about that. use date_format(%Y-%m-%d,'date_column') in the sql

Re: [PHP] date question

2003-11-20 Thread John Nichel
Martin Cameron wrote: $ndays=14; function get_next_dates($ndays) { $today=date(m-d-Y,mktime(0,0,0,date(m),date(d),date(Y))); $forward_date=date(m-d-Y,mktime(0,0,0,date(m),date(d)+$few_days,date(Y))); print h1$today === $few_days === $forward_date/h1; for($i=0;$i$ndays;$i++) {

Re: [PHP] date question

2003-11-20 Thread Ahbaid Gaffoor
Beautiful, many thanks Ahbaid. Martin Cameron wrote: $ndays=14; function get_next_dates($ndays) { $today=date(m-d-Y,mktime(0,0,0,date(m),date(d),date(Y))); $forward_date=date(m-d-Y,mktime(0,0,0,date(m),date(d)+$few_days,date(Y))); print h1$today === $few_days === $forward_date/h1;

[PHP] date question

2003-11-19 Thread Ahbaid Gaffoor
Hello all, I would like to create a php function as follows: function get_next_dates($ndays) { /* 1. get the current date 2. create an array say $results 3. Store the dates for the next $ndays in $results */ return $results } So in my main program I can include the file with

RE: [PHP] date question

2003-11-19 Thread Daniel Purdy
quote Hello all, I would like to create a php function as follows: function get_next_dates($ndays) { /* 1. get the current date 2. create an array say $results 3. Store the dates for the next $ndays in $results */ return $results } So in my main program I can

[PHP] date question

2003-11-19 Thread Martin Cameron
$ndays=14; function get_next_dates($ndays) { $today=date(m-d-Y,mktime(0,0,0,date(m),date(d),date(Y))); $forward_date=date(m-d-Y,mktime(0,0,0,date(m),date(d)+$few_days,date(Y))); print h1$today === $few_days === $forward_date/h1; for($i=0;$i$ndays;$i++) {

[PHP] DATE Question

2003-10-05 Thread Shaun
Hi, is there a function in PHP that will work out the amount of time(hours) beween two different dates / times? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] DATE Question

2003-10-05 Thread Chris Shiflett
--- Shaun [EMAIL PROTECTED] wrote: is there a function in PHP that will work out the amount of time(hours) beween two different dates / times? You can just subtract the timestamps the find the number of seconds between any two times. PHP has a rich set of functions to help you generate

Re: [PHP] Date question

2003-05-30 Thread Shaun
, 2003 6:39 AM To: [EMAIL PROTECTED] Subject: [PHP] Date question Hi, For a given date, how can i find out the date of the day of the begining of that week? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP

Re: [PHP] Date question

2003-05-30 Thread Wendell Brown
On Thu, 29 May 2003 15:40:00 +0100, Shaun wrote: of course ;) but i couldn't find a reference to this particular problem... I don't think you are going to find a standard PHP function to do this. You are going to have to do something like this (I haven't tried it but I think it will do what

RE: [PHP] Date question

2003-05-30 Thread Ford, Mike [LSS]
://www.php.net ? -Original Message- From: Shaun [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 6:39 AM To: [EMAIL PROTECTED] Subject: [PHP] Date question Hi, For a given date, how can i find out the date of the day of the begining of that week? Have you tried searching

Re: [PHP] Date question

2003-05-30 Thread Jason Wong
On Thursday 29 May 2003 22:40, Shaun wrote: of course ;) Try: $start_date_ts = time(); if ('Mon' != date('D', $start_date_ts)) { $start_date_ts = strtotime(last monday); } $start_date= strftime(%Y-%m-%d, $start_date_ts); echo $start_date; Season to taste.

[PHP] Date question

2003-05-29 Thread Shaun
Hi, For a given date, how can i find out the date of the day of the begining of that week? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Date question

2003-05-29 Thread Jay Blanchard
Have you checked the date functions at http://www.php.net ? -Original Message- From: Shaun [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 6:39 AM To: [EMAIL PROTECTED] Subject: [PHP] Date question Hi, For a given date, how can i find out the date of the day of the begining

[PHP] date question

2003-03-19 Thread Charles Kline
Hi all, I have a form where users will be adding publication dates for uploaded files. I want to store the date in mySQL as date('U') format. If the date is entered as mm/dd/ - will the date function know this or is there some way of 'telling' php how the date to be converted is

Re: [PHP] date question

2003-03-19 Thread Kevin Stone
- Original Message - From: Charles Kline [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 2:17 PM Subject: [PHP] date question Hi all, I have a form where users will be adding publication dates for uploaded files. I want to store the date in mySQL as date('U

[PHP] Date Question.

2003-03-05 Thread Sebastian
I have a date field in mysql in this format: Y-m-d H:i:s I would like to echo Today if the date is today, can someone offer some help? Thanks. warm regards, Sebastian - [BBR] Gaming Clan http://www.broadbandreports.com

RE: [PHP] Date Question.

2003-03-05 Thread Don Read
On 05-Mar-2003 Sebastian wrote: I have a date field in mysql in this format: Y-m-d H:i:s I would like to echo Today if the date is today, can someone offer some help? Thanks. SELECT IF(TO_DAYS(datefld)=TO_DAYS(current_date),'Today',LEFT(datefld,10)) as datefld, ... Regards, -- Don Read

[PHP] Date question

2003-03-01 Thread Sebastian
Greetings all. I have used strtotime() function in the past, and done this: if($time = strtotime('24 hours ago')) { $new = new!; } with it being in UNIX time stamp .. But now I have a different client where the time stamp in mysql is formatted like: 2002-08-29 10:53:09 what function would I

RE: [PHP] Date question

2003-03-01 Thread John W. Holmes
I have used strtotime() function in the past, and done this: if($time = strtotime('24 hours ago')) { $new = new!; } with it being in UNIX time stamp .. But now I have a different client where the time stamp in mysql is formatted like: 2002-08-29 10:53:09 what function would I use in

Re: [PHP] Date question

2003-03-01 Thread Sebastian
] To: 'Sebastian' [EMAIL PROTECTED]; 'php list' [EMAIL PROTECTED] Sent: Sunday, March 02, 2003 12:40 AM Subject: RE: [PHP] Date question | | SELECT column - INTERVAL 24 HOUR FROM your_table WHERE ... | | ---John W. Holmes... - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: 'Sebastian

Re: [PHP] Date question

2003-03-01 Thread Tom Rogers
Hi, Sunday, March 2, 2003, 3:39:37 PM, you wrote: S Greetings all. S I have used strtotime() function in the past, and done this: if($time = strtotime('24 hours ago')) { S $new = new!; S } S with it being in UNIX time stamp .. But now I have a different client where S the time stamp in mysql

[PHP] date question

2002-09-29 Thread Jonas Geiregat
I have a date ex 24/08/02 and I need to see if that date is the same date as it is today (only one month later) but 5day's in advanced = that would be 24/09/02 so if(date == date now - 5) {true} else{false} how can I do this right ? -- PHP General

Re: [PHP] date question

2002-09-29 Thread Justin French
Not sure why you need the 5 days in advance bit, but this might give you the tools to work it all out. I prefer to work with dates in unix timestamp format (seconds). To get now, use time() To get next month, there's a kewl function called strtotime(), which converts english phrases into

[PHP] date question

2002-09-09 Thread Meltem Demirkus
Hi, Is there any function which returns the day , month or year of a date ? thanks meltem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] date question

2002-09-09 Thread Rudolf Visagie
Hi Meltem, The PHP manual is at http://www.php.net/manual/en (mirror sites as well). -Original Message- From: Meltem Demirkus [mailto:[EMAIL PROTECTED]] Sent: Monday, September 09, 2002 1:30 PM To: [EMAIL PROTECTED] Subject: [PHP] date question Hi, Is there any function which

[PHP] date Question

2002-05-20 Thread Randy Johnson
Is their a way to retrieve the previous month using/altering the code below: // get the current timestamp into an array $timestamp = time(); $date_time_array = getdate($timestamp); $month = $date_time_array[mon]; $day = $date_time_array[mday]; $year =

Re: [PHP] date Question

2002-05-20 Thread Jason Wong
On Monday 20 May 2002 23:01, Randy Johnson wrote: Is their a way to retrieve the previous month using/altering the code below: // get the current timestamp into an array $timestamp = time(); $date_time_array = getdate($timestamp); $month = $date_time_array[mon]; $day =

Re: [PHP] date Question

2002-05-20 Thread Justin French
Hi, If you want last month from the *CURRENT* date + time, then look at something like strtotime('last month'), which may help, generating a time stamp of the same day, time, etc in the previous month. To format a different time stamp into what you want, consider the date() function in the

[PHP] Date Question: finding 1st Monday of sept.

2002-02-22 Thread Jeff Bearer
Hello, I'm trying to find out how to calculate some dates, and the part I'm having problems with is finding the date of the first Monday in September. I'm looking into the strtotime() function which works some great magic with dates, but I can't figure out how to use the day of the week syntax

RE: [PHP] Date Question

2001-03-08 Thread Jeff Oien
If you put the date in MMDD format you can compare the numbers. http://www.php.net/manual/en/function.date.php Jeff Oien Hi, Since there is no Date type in php, is there a way to compare dates? Something like: if ((3/8/2001) (3/9/2001)){ // Date is newer } Thanks, Chris

RE: [PHP] Date Question

2001-03-08 Thread John Huggins
= $currentEpochTime - $epochTime; I hope this provides a clue for your application. John -Original Message- From: Chris [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 08, 2001 12:12 PM To: php Subject: [PHP] Date Question Hi, Since there is no Date type in php, is there a

Re: [PHP] Date Question

2001-03-08 Thread Jason Jacobs
Ok, I understand that the epoch is a point in time that's static, but what exactly is the epoch? I've heard it mentioned a lot on the list, but I have no idea what it really is. :) Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: [PHP] Date Question

2001-03-08 Thread John Huggins
] Date Question Ok, I understand that the epoch is a point in time that's static, but what exactly is the epoch? I've heard it mentioned a lot on the list, but I have no idea what it really is. :) Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

Re: [PHP] date question

2001-01-24 Thread Hardy Merrill
Which database? Fang Li [[EMAIL PROTECTED]] wrote: There is a LiveDate (-MM-DD) field in my table. 1. I want data from last 5 days up to now, and its order should be from latest; 2. I want data for next month. Any help would be appreciated. -- PHP General Mailing List