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 usin
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
http://www.purewe
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
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
http://dev.mysql.com
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 date_format("%Y-%m-
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 dates
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 (http://www.php.net/)
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 "$today === $few_days === $forward_date";
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 "$today === $few_days === $forward_date";
for($i=0;$i<$ndays;$i++)
{
$ne
$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 "$today === $few_days === $forward_date";
for($i=0;$i<$ndays;$i++)
{
$new_days_array[]=date(
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 th
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
--- 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 times
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
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 tas
news:[EMAIL PROTECTED]
> 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,
>
>
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
ECTED]
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?
Thanks for your help
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://
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
of
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
- 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
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
formatted,
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
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
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 i
Holmes" <[EMAIL PROTECTED]>
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 .
> 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
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
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 ti
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 Mail
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
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
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 man
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"];
>
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 = $date_time_arra
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
s
bject: Re: [PHP] 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 G
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 additional
conds = $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 the
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,
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
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 Li
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 (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For add
43 matches
Mail list logo