How do I break $start_date into 3 variables --- 4 digit year, 2 digit
month and 2 digit day?
$start_year = ;
$start_month = ;
$start_day = ;
?PHP
$start_date='2007-06-20';
$parts=explode('-',$start_date);
$start_year = $parts[0];
$start_month = $parts[1];
$start_day = $parts[2];
If you are pulling $start_date from a database, depending on the format you
could use something like the following:
Assuming the data is 20070215.
Connect and query your database, get the result and assign it to a variable.
$start_date = $my_result_row['start_date'];
$start_year =
Don't forget that in cases like the one below, you can use the list() function
to tighten things up a bit:
$start_date='2007-06-20';
list($start_year, $start_month, $start_day) = explode('-',$start_date);
I prefer using the date functions that some of the other people mentioned and
only use
Larry Garfield wrote:
(Note: strtotime() is probably not the fastest to execute way of doing it, but
it's the fastest to write. Choose wisely.)
Is it? How about:
$timestamp = strtotime($expiry_date) + (86400 * 7);
--
Richard Heyes
0844 801 1072
http://www.websupportsolutions.co.uk
Knowledge
Hello,
There's another way out there using mysql
SELECT DATE_ADD('$expiry_date', INTERVAL 7 DAY) as fDate
but off course not a recommended way. In fact you can use it update query
(update tbl_name set expiry_date = date_add('$expiry_date', INTERVAL 7 DAY)
where user ='$user')
--
Shafiq Rehman
Shafiq Rehman wrote:
Hello,
There's another way out there using mysql
SELECT DATE_ADD('$expiry_date', INTERVAL 7 DAY) as fDate
but of course not a recommended way.
So why suggest it?
In fact you can use it update query
(update tbl_name set expiry_date = date_add('$expiry_date', INTERVAL 7
On 6/19/07, Richard Heyes [EMAIL PROTECTED] wrote:
Shafiq Rehman wrote:
Hello,
There's another way out there using mysql
SELECT DATE_ADD('$expiry_date', INTERVAL 7 DAY) as fDate
but of course not a recommended way.
So why suggest it?
just to share the knowledge
In fact you can use
If
$expiry_date = 2007-10-17;
How do I add 7 days to this? I know the strtotime(+7 days); command,
but don't know how to make it work with a date that isn't today.
(Please respond directly to my e-mail address)
Ron
On Mon, 2007-06-18 at 21:57 -0400, Ron Piggott wrote:
If
$expiry_date = 2007-10-17;
How do I add 7 days to this? I know the strtotime(+7 days); command,
but don't know how to make it work with a date that isn't today.
You would do:
strtotime( '+7 days', $time );
The $time is a unix
On Monday 18 June 2007, Robert Cummings wrote:
On Mon, 2007-06-18 at 21:57 -0400, Ron Piggott wrote:
If
$expiry_date = 2007-10-17;
How do I add 7 days to this? I know the strtotime(+7 days); command,
but don't know how to make it work with a date that isn't today.
You would do:
Sorry I am a bit of a newbie with php and hope this has not been aswered a
million times, but here it goes
I have a date base with a couple of date fields when I pull up and display
the fields it show 2007-05-21. the question I have is how to convert the
field to 05-21-2007?
Currently the
On 5/21/07, Mike Ryan [EMAIL PROTECTED] wrote:
Sorry I am a bit of a newbie with php and hope this has not been aswered a
million times, but here it goes
I have a date base with a couple of date fields when I pull up and display
the fields it show 2007-05-21. the question I have is how to
2007. 03. 30, péntek keltezéssel 14.00-kor Jason Pruim ezt írta:
On Mar 29, 2007, at 4:52 PM, Zoltán Németh wrote:
snip
(I assume you want this calculation within one given day)
you could read all rows into an array like
$timeinfo = array();
$sql = SELECT minute, sequence FROM
On Mar 29, 2007, at 6:16 PM, Jim Lucas wrote:
you stated in a different email that there are 6 possible values/
settings for the sequence col.
what are they, and what do they mean?
One person asked about missed punches. What happens if someone
forgets to clock out? Is an entry made for
On Mar 29, 2007, at 4:52 PM, Zoltán Németh wrote:
snip
(I assume you want this calculation within one given day)
you could read all rows into an array like
$timeinfo = array();
$sql = SELECT minute, sequence FROM table WHERE day='$day';
$result = mysql_query($result);
while ($row =
Thanks everyone for your suggestions, it turns out it was a unix time
stamp and I can get it to parse out a normal date now.
Now... on to the harder part
What I am trying to do is learn... This is kind of just a pet project
for me to figure out how I can do it. here is how the database
2007. 03. 29, csütörtök keltezéssel 16.38-kor Jason Pruim ezt írta:
Thanks everyone for your suggestions, it turns out it was a unix time
stamp and I can get it to parse out a normal date now.
Now... on to the harder part
What I am trying to do is learn... This is kind of just a pet
Jason Pruim wrote:
Thanks everyone for your suggestions, it turns out it was a unix time
stamp and I can get it to parse out a normal date now.
Now... on to the harder part
What I am trying to do is learn... This is kind of just a pet project
for me to figure out how I can do it. here
Roberto Mansfield wrote:
Jason Pruim wrote:
Thanks everyone for your suggestions, it turns out it was a unix time
stamp and I can get it to parse out a normal date now.
Now... on to the harder part
What I am trying to do is learn... This is kind of just a pet project
for me to figure out
Jason Pruim wrote:
Hi Everyone,
First off, I'm using PHP 5.2.0 and apache 1.3.33
I am trying to figure out what format a string is in in a database. It's
a timecard system that I have found on-line and I am attempting to
figure out how to write a script that would give me everyones timecard
Hi Everyone,
First off, I'm using PHP 5.2.0 and apache 1.3.33
I am trying to figure out what format a string is in in a database.
It's a timecard system that I have found on-line and I am attempting
to figure out how to write a script that would give me everyones
timecard for the month on
Jason Pruim wrote:
Hi Everyone,
First off, I'm using PHP 5.2.0 and apache 1.3.33
I am trying to figure out what format a string is in in a database.
It's a timecard system that I have found on-line and I am attempting
to figure out how to write a script that would give me everyones
timecard
Jason Pruim wrote:
Hi Everyone,
First off, I'm using PHP 5.2.0 and apache 1.3.33
I am trying to figure out what format a string is in in a database.
It's a timecard system that I have found on-line and I am attempting
to figure out how to write a script that would give me everyones
2007. 03. 28, szerda keltezéssel 15.35-kor Jason Pruim ezt írta:
Hi Everyone,
First off, I'm using PHP 5.2.0 and apache 1.3.33
I am trying to figure out what format a string is in in a database.
It's a timecard system that I have found on-line and I am attempting
to figure out how to
Zoltán Németh wrote:
2007. 03. 28, szerda keltezéssel 15.35-kor Jason Pruim ezt írta:
Hi Everyone,
First off, I'm using PHP 5.2.0 and apache 1.3.33
I am trying to figure out what format a string is in in a database.
It's a timecard system that I have found on-line and I am attempting
to
, which is the type of date that the php date()
function takes as a 2nd parameter. So for example,
?php
echo date(m/d/Y, $row['day']) // Output: 02/18/2007
?
You can also format it in the query like so:
mysql SELECT FROM_UNIXTIME(day) AS theDate FROM myTable;
Output: 2007-02-18 00:00:00
2007. 03. 28, szerda keltezéssel 14.48-kor Travis Doherty ezt írta:
Zoltán Németh wrote:
2007. 03. 28, szerda keltezéssel 15.35-kor Jason Pruim ezt írta:
Hi Everyone,
First off, I'm using PHP 5.2.0 and apache 1.3.33
I am trying to figure out what format a string is in in a
Dear All,
I was wondering if there are any major date function changes between php4 and
5.
When I say date function I mean mktime() , date() ,strtotime() etc.
Here is my dilemma, I've upgraded from php4 to php5. there is some very old
legacy code that is not working correctly.
Specifically
Paul Nowosielski wrote:
Dear All,
I was wondering if there are any major date function changes between php4 and
5.
I don't think so but check the docs:
http://www.php.net/manual/en/faq.migration5.php
When I say date function I mean mktime() , date() ,strtotime() etc.
Here is my dilemma,
:18 PM
To: Paul Nowosielski
Cc: php-general@lists.php.net
Subject: Re: [PHP] Date functions differences between php 4 and 5
Paul Nowosielski wrote:
Dear All,
I was wondering if there are any major date function
changes between php4 and
5.
I don't think so but check the docs
On Thu, February 1, 2007 6:30 pm, John Taylor-Johnston wrote:
How do I take 2007-02-01 and turn it into Thursday, February 1,
2006?
Simple question, except I don't know the answer :)
This is all I see for now:
http://ca.php.net/manual/en/function.px-date2string.php
list($year, $month, $day)
How do I take 2007-02-01 and turn it into Thursday, February 1, 2006?
Simple question, except I don't know the answer :)
This is all I see for now:
http://ca.php.net/manual/en/function.px-date2string.php
John
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
John Taylor-Johnston wrote:
How do I take 2007-02-01 and turn it into Thursday, February 1, 2006?
Use strtotime (http://php.net/strtotime) to turn it into a timestamp and
then format it using date (http://php.net/date).
--
Postgresql php tutorials
http://www.designmagick.com/
--
PHP
Chris wrote:
John Taylor-Johnston wrote:
How do I take 2007-02-01 and turn it into Thursday, February 1, 2006?
Use strtotime (http://php.net/strtotime) to turn it into a timestamp and
then format it using date (http://php.net/date).
echo date(l, F j, Y, strtotime(2007-02-01));
That's it?
John Taylor-Johnston wrote:
Chris wrote:
John Taylor-Johnston wrote:
How do I take 2007-02-01 and turn it into Thursday, February 1, 2006?
Use strtotime (http://php.net/strtotime) to turn it into a timestamp
and then format it using date (http://php.net/date).
echo date(l, F j, Y,
On Sat, January 27, 2007 10:51 pm, Ron Piggott wrote:
I have date in the variable $date_reference in the format -MM-DD.
How do I find out the date before this and the date after this? Ron
$date_reference = date('Y-m-d');
list($y, $m, $d) = explode('-', $date_reference);
//Let the computer
Ron Piggott wrote:
I have date in the variable $date_reference in the format -MM-DD.
How do I find out the date before this and the date after this? Ron
Not enough information, Ron. Do you mean: 1. as exists in some data set that
you've created or stored, like in an array or a
Someone sent me the strtotime function. This was the command I was
needing. Ron
On Sun, 2007-01-28 at 08:57 -0600, David Giragosian wrote:
Ron Piggott wrote:
I have date in the variable $date_reference in the format
-MM-DD.
How do I find out the date
I have date in the variable $date_reference in the format -MM-DD.
How do I find out the date before this and the date after this? Ron
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Read http://us3.php.net/manual/en/function.strtotime.php.
It might help.
On 1/27/07, Ron Piggott [EMAIL PROTECTED] wrote:
I have date in the variable $date_reference in the format -MM-DD.
How do I find out the date before this and the date after this? Ron
--
PHP General Mailing List
On sáb, 2007-01-27 at 23:51 -0500, Ron Piggott wrote:
I have date in the variable $date_reference in the format -MM-DD.
How do I find out the date before this and the date after this? Ron
http://us3.php.net/manual/en/function.date.php#68716
RTFM :-P
signature.asc
Description: This is
Hi All,
I have a database with a bunch of dates in it. I want to count the number of
entries for each year and then display the year and the count.
i.e.
YearCount
200622
200518
200414
200322
This is what I have tried but just not quite getting it.
$query select count(date)
Beauford wrote:
$query select count(date) as count, YEAR(date) as thisyear from stats group
^ = needed here
by thisyear;
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Yea, I just figured this out. When I cut and pasted I must have overwrote
the =.
Thanks
-Original Message-
From: Stut [mailto:[EMAIL PROTECTED]
Sent: January 4, 2007 4:27 PM
To: Beauford
Cc: PHP
Subject: Re: [PHP] Date problems
Beauford wrote:
$query select count(date
Hello,
I have a lot of php scripts that uses date() for some important
operations. Yesterday those scripts were moved to another server which is on an
different timezone. I haven't predicted this so my scripts aren't working
anymore. The
servers timezone is GMT -4 and mine is GMT -2. Is there
Fernando M. M. wrote:
Hello,
I have a lot of php scripts that uses date() for some important
operations. Yesterday those scripts were moved to another server which is on
an
different timezone. I haven't predicted this so my scripts aren't working
anymore. The
servers timezone is GMT
Fernando M. M. wrote:
I have a lot of php scripts that uses date() for some important
operations. Yesterday those scripts were moved to another server which is on an
different timezone. I haven't predicted this so my scripts aren't working
anymore. The
servers timezone is GMT -4 and mine is GMT
I´m using php5 here.
But like i said i have lots of scripts inside this
folder, is there a way to set something on .htaccess to change the timezone?
Fernando M. M. wrote:
Hello,
I have a lot of php scripts that uses date() for some
important
operations. Yesterday those scripts were
Fernando M. M. wrote:
I´m using php5 here.
But like i said i have lots of scripts inside this
folder, is there a way to set something on .htaccess to change the timezone?
yes. I suggest you actually following the given links and read what's there -
that's what I did to answer your
have you ever had the need to programmatically convert a date()
compatible date formatting string with one compatible for strftime()?
I had this problem recently when I had to l10n an existing app (and
support legacy data - which include date() formatting strings - at the
same time) ... I came up
On Tue, 14 Nov 2006 15:11:56 -0500, Brad Fuller wrote:
$prevminute = sprintf('%02s', date(i)-1);
Or, $prevminute = str_pad(date(i)-1, 2, '0', STR_PAD_LEFT);
It's a little more code - don't ask me about the speed :)
Ivo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
I noticed that if I do something like this:
$prevminute = date(i)-1;
..and the current minute happens to be '05', $prevminute becomes '4'
- I lose the padding. How can I ensure that I retain that padding? I
suppose a crud solution is to run $prevminute through an if loop to see
$prevminute = sprintf('%02s', date(i)-1);
-Original Message-
From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 14, 2006 1:17 PM
To: PHP General List
Subject: [PHP] date() function
I noticed that if I do something like this:
$prevminute
I have one more date based question.
I have a month field ( $month ) and a day field ( $day ) being submitted
by a form.
I have a third field to be used as a date reminder for the information
which was submitted as part of the form. It is a reminder to complete a
task for the date was which was
Ron Piggott (PHP) wrote:
I have one more date based question.
I have a month field ( $month ) and a day field ( $day ) being submitted
by a form.
I have a third field to be used as a date reminder for the information
which was submitted as part of the form. It is a reminder to complete a
task
Is there a PHP function which verifies a valid date has been entered
(-MM-DD)? Ron
Ron Piggott (PHP) wrote:
Is there a PHP function which verifies a valid date has been entered
(-MM-DD)? Ron
preg_match('/^(\d{4})-(\d\d)-(\d\d)\z/', $s, $m) checkdate($m[2],
$m[3], $m[1])
Arpad
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Ron Piggott (PHP) wrote:
Is there a PHP function which verifies a valid date has been entered
(-MM-DD)? Ron
http://www.php.net/manual/en/function.checkdate.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Mon, October 9, 2006 11:26 am, Ron Piggott (PHP) wrote:
Is there a PHP function which verifies a valid date has been entered
(-MM-DD)? Ron
Note that both solutions so far are only partial solutions for most
real world scenarios.
For example:
0001-12-25
will pass both, and would appear
At 9:19 PM +0100 9/10/06, Dave Goodchild wrote:
Has anyone out there had to deal with a similar problem, and if so do you
have any advice. This is going to take time so I will be patient and
continue, and welcome any suggestions. Many thanks and I can post code to
specific requests.
Dave:
You
Hi all. I am in the midst of creating a national online events directory (ie
evening classes, coffee mornings, yard sales etc). The user is able to enter
one-off events or regular events (daily, weekly, monthly) and each event
entered makes up one record in the events table in the db (mysql).
that your date/time strings
conform to the GNU datetime specs.
2. There are 86400 seconds in a day.
3. Date also accepts parameters like +1month and -1month, this works for
days, weeks, months etc.
4. Google php calendar class and php date class you will get like a
bazillion resources
I've always been really amazed at how well strtotime works, but recently
ran into an issue where it couldn't figure out the date if it was a cc
exp date in long format, e.g. 1/2009. I was curious if anyone else has
run into this and how did they get around it, here was my solution:
function
: [PHP] date(n/Y) strtotime
I've always been really amazed at how well strtotime works, but recently
ran into an issue where it couldn't figure out the date if it was a cc
exp date in long format, e.g. 1/2009. I was curious if anyone else has
run into this and how did they get around it, here
{
Echo 'true';
}
All of those echo true, how do I determine if strtotime has failed or
not?
Mark
-Original Message-
From: Mark Steudel
Sent: Wednesday, August 02, 2006 9:55 AM
To: Mark Steudel; PHP Mailing Lists
Subject: RE: [PHP] date(n/Y) strtotime
Ok so actually I didn't solve
' )
{
Echo 'false';
}
Else
{
Echo 'true';
}
All of those echo true, how do I determine if strtotime has failed or
not?
Mark
-Original Message-
From: Mark Steudel
Sent: Wednesday, August 02, 2006 9:55 AM
To: Mark Steudel; PHP Mailing Lists
Subject: RE: [PHP] date(n/Y) strtotime
Ok so actually
Thanks Adam,
I had sent out my second email before I had read yours. I'll give yours
a go, thanks again.
Mark
-Original Message-
From: Adam Zey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 02, 2006 11:15 AM
To: Mark Steudel
Cc: PHP Mailing Lists
Subject: Re: [PHP] date(n/Y
email before I had read yours. I'll give yours
a go, thanks again.
Mark
-Original Message-
From: Adam Zey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 02, 2006 11:15 AM
To: Mark Steudel
Cc: PHP Mailing Lists
Subject: Re: [PHP] date(n/Y) strtotime
Mark Steudel wrote
,$syear);
$dates[$i] = date( m/d/Y, $added );
}
return $dates;
}
[SNIP]
Good luck,
Jef
-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 23, 2006 3:27 PM
To: Dave Goodchild
Cc: php-general@lists.php.net
Subject: Re: [PHP
Hi all, I am writing an app that runs a prize draw, wherein the admin
chooses the duration by adding a start date and number of days for the draw
to run. These values are passed into a small function that generates an
array holding the start date, end date and all dates in between as follows:
On 5/23/06, Dave Goodchild [EMAIL PROTECTED] wrote:
Hi all, I am writing an app that runs a prize draw, wherein the admin
chooses the duration by adding a start date and number of days for the draw
to run. These values are passed into a small function that generates an
array holding the start
mktime() args are hour/minute/second/month/day/year or somesuch.
You are passing in a string, which PHP tries to convert to int, which
results in who knows what, on the line that starts $added =
On Tue, May 23, 2006 6:11 am, Dave Goodchild wrote:
Hi all, I am writing an app that runs a prize
]
Sent: Sunday, May 21, 2006 12:18 PM
To: Rabin Vincent; php-general@lists.php.net
Subject: Re: [PHP] Date() finding yesterday
mktime also works: http://php.net/mktime:
date(Y-m-d, mktime( ... ))
On 5/21/06, Rabin Vincent [EMAIL PROTECTED] wrote:
On 5/21/06, John Taylor-Johnston
[EMAIL PROTECTED
mktime also works: http://php.net/mktime:
date(Y-m-d, mktime( ... ))
On 5/21/06, Rabin Vincent [EMAIL PROTECTED] wrote:
On 5/21/06, John Taylor-Johnston
[EMAIL PROTECTED] wrote:
I cannot seem to get this right. How can I produce yesterday?
$today = date(Y-m-d);
$yesterday = date(Y-m-) .
I cannot seem to get this right. How can I produce yesterday?
$today = date(Y-m-d);
$yesterday = date(Y-m-) . date(d)-1;
$yesterday = date(Y-m-d)-1;
$yesterday = date(Y-m-.d-1);
I've been looking at the manual :) ...
Thanks,
John
--
PHP General Mailing List (http://www.php.net/)
To
On 5/21/06, John Taylor-Johnston
[EMAIL PROTECTED] wrote:
I cannot seem to get this right. How can I produce yesterday?
$today = date(Y-m-d);
$yesterday = date(Y-m-) . date(d)-1;
$yesterday = date(Y-m-d)-1;
$yesterday = date(Y-m-.d-1);
I've been looking at the manual :) ...
Use
I'd agree with what Richard is alluding to: turn your two dates into
timestamps, and then compare those. mktime() or strtotime() should
help you out.
HTH,
John W
On 4/18/06, Richard Lynch [EMAIL PROTECTED] wrote:
http://php.net/mktime may be more suitable, depending on the date
range of the
Hi everyone,
this is the function I have written for comparing a date time please tell me
if my logic is correct ? and if there's a better alternative please let me
know of that as well.
// This function will return 1 if supplied date is expired
function is_expire($expiry_date){
http://php.net/mktime may be more suitable, depending on the date
range of the input.
That said, as far as I can tell, your $formated_expiry_date is the
SAME as your $expiry_date, except possibly for some separation
characters.
If the separation characters are ALWAYS the same, you could just do:
);
Satyam
- Original Message -
From: Mace Eliason [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Sunday, April 09, 2006 4:14 AM
Subject: [PHP] Date problems
Hi,
I am having troubles adding 7 days to the current date. I have been
reading through php.net date() and this is what I
Satyam wrote:
Timestamps are stored as seconds from a certain date. The base date
differ depending on the platform, Windows use 1/1/1980 the rest
1/1/1970, but still seconds. 7 days are 7*24*60*60. Just add that much
to a timestamp. It helps having a constant such as:
define
Hi,
I am having troubles adding 7 days to the current date. I have been
reading through php.net date() and this is what I have come up with but
it doesn't work
$today = date('m/d/Y');
$nextweek = date('m/d/Y',mktime(date(m), date(d)+7, date(Y)));
if I echo the above variables they are the
Mace Eliason wrote:
Hi,
I am having troubles adding 7 days to the current date. I have been
reading through php.net date() and this is what I have come up with but
it doesn't work
$today = date('m/d/Y');
$nextweek = date('m/d/Y',mktime(date(m), date(d)+7, date(Y)));
if I echo the above
Rasmus Lerdorf wrote:
Mace Eliason wrote:
Hi,
I am having troubles adding 7 days to the current date. I have been
reading through php.net date() and this is what I have come up with
but it doesn't work
$today = date('m/d/Y');
$nextweek = date('m/d/Y',mktime(date(m), date(d)+7, date(Y)));
Hi
I am having an unusual problem when trying to calculate dates in advance
from a start date. the code below shows a loop where by on each run an
increasing number of weeks is added to the start date, this works as
expected up untill the 8th time where for some reason it produces
01-11-05
Cause 9th month have 30 days but 10th month have 31 days. You don't check the
amount of day there... :)
on Wednesday 29 March 2006 14:51, Adrian Bruce wrote:
Hi
I am having an unusual problem when trying to calculate dates in advance
from a start date. the code below shows a loop where by
That should not effect it, if i am adding $i * 7 days each time then i
should get the date that comes 7 days later irrespective of how many
days are in the month, shouldn't I ? 8 * 7 = 56, 56 days after the
07-09-05 is 02-11-2005.
Thomas Munz wrote:
Cause 9th month have 30 days but 10th
I have come up with an alternative myself but still cant explain why the
first method did not work, still be interested to know why if anyone can
offer some thoughts. Using strtotime for the calc seems to produce
correct results
my soluiton:
[snip]
?php
echoh1 date test 2/h1;
$start =
-Original Message-
From: Adrian Bruce [mailto:[EMAIL PROTECTED]
Sent: 29 March 2006 13:52
I am having an unusual problem when trying to calculate dates
in advance
from a start date. the code below shows a loop where by on
each run an
increasing number of weeks is added to
Hi:
The problem is that you have transposed your date elements.
See this:
http://xn--ovg.com/a3.php
Try this code:
?php
echoh1 date test (d/m/y)/h1;
$start = 05-09-07;
$start = explode('-',$start);
$startmk = mktime(0,0,0,$start[1],$start[0],$start[2]);
$startdate = date('d-m-y',$startmk);
: Wednesday, March 29, 2006 2:52 PM
To: php-general@lists.php.net
Subject: [PHP] Date addition problem
Hi
I am having an unusual problem when trying to calculate dates in advance
from a start date. the code below shows a loop where by on each run an
increasing number of weeks is added to the start date
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
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
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
I need to loop from a date in the past to current date getting all
dates in between. Anyone have an idea on how to do that?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
@lists.php.net
Subject: [PHP] date from -MM-DD to current date
I need to loop from a date in the past to current date getting all
dates in between. Anyone have an idea on how to do that?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
.
-Original Message-
From: Dan McCullough [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 15, 2006 10:22 AM
To: Shaunak Kashyap
Subject: Re: [PHP] date from -MM-DD to current date
excellent, I was getting close, was getting hung up on a couple of
things
On 3/15/06, Shaunak Kashyap
: [PHP] date from -MM-DD to current date
excellent, I was getting close, was getting hung up on a couple of
things
On 3/15/06, Shaunak Kashyap [EMAIL PROTECTED] wrote:
// $pastDateStr = string representation of past date
$pastDateTS = strtotime($pastDateStr
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
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
201 - 300 of 1042 matches
Mail list logo