RE: [PHP] Date

2007-06-20 Thread Jim Moseby
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];

Re: [PHP] Date

2007-06-20 Thread Dan Shirah
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 =

RE: [PHP] Date

2007-06-20 Thread tg-php
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

Re: [PHP] Date

2007-06-19 Thread Richard Heyes
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

Re: [PHP] Date

2007-06-19 Thread Shafiq Rehman
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

Re: [PHP] Date

2007-06-19 Thread Richard Heyes
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

Re: [PHP] Date

2007-06-19 Thread Shafiq Rehman
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

[PHP] Date

2007-06-18 Thread Ron Piggott
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

Re: [PHP] Date

2007-06-18 Thread Robert Cummings
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

Re: [PHP] Date

2007-06-18 Thread Larry Garfield
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:

[PHP] date format from a database date field

2007-05-23 Thread Mike Ryan
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

Re: [PHP] date format from a database date field

2007-05-23 Thread Daniel Brown
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

Re: [PHP] Date/time format?

2007-04-02 Thread Zoltán Németh
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

Re: [PHP] Date/time format?

2007-03-30 Thread Jason Pruim
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

Re: [PHP] Date/time format?

2007-03-30 Thread Jason Pruim
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 =

Re: [PHP] Date/time format?

2007-03-29 Thread Jason Pruim
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

Re: [PHP] Date/time format?

2007-03-29 Thread Zoltán Németh
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

Re: [PHP] Date/time format?

2007-03-29 Thread Roberto Mansfield
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

Re: [PHP] Date/time format?

2007-03-29 Thread Jim Lucas
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

Re: [PHP] Date/time format?

2007-03-29 Thread Jim Lucas
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

[PHP] Date/time format?

2007-03-28 Thread Jason Pruim
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

Re: [PHP] Date/time format?

2007-03-28 Thread Brad Bonkoski
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

Re: [PHP] Date/time format?

2007-03-28 Thread Travis Doherty
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

Re: [PHP] Date/time format?

2007-03-28 Thread Zoltán Németh
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

Re: [PHP] Date/time format?

2007-03-28 Thread Travis Doherty
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

RE: [PHP] Date/time format?

2007-03-28 Thread Brad Fuller
, 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

Re: [PHP] Date/time format?

2007-03-28 Thread Zoltán Németh
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

[PHP] Date functions differences between php 4 and 5

2007-03-22 Thread Paul Nowosielski
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

Re: [PHP] Date functions differences between php 4 and 5

2007-03-22 Thread Chris
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,

RE: [PHP] Date functions differences between php 4 and 5

2007-03-22 Thread Jake McHenry
: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

Re: [PHP] date to string

2007-02-02 Thread Richard Lynch
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)

[PHP] date to string

2007-02-01 Thread John Taylor-Johnston
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:

Re: [PHP] date to string

2007-02-01 Thread Chris
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

Re: [PHP] date to string

2007-02-01 Thread John Taylor-Johnston
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?

Re: [PHP] date to string

2007-02-01 Thread Chris
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,

Re: [PHP] DATE

2007-01-29 Thread Richard Lynch
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

Re: [PHP] DATE

2007-01-28 Thread David Giragosian
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

Re: [PHP] DATE

2007-01-28 Thread Ron Piggott
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

[PHP] DATE

2007-01-27 Thread Ron Piggott
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

Re: [PHP] DATE

2007-01-27 Thread Casey Chu
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

Re: [PHP] DATE

2007-01-27 Thread Francisco M. Marzoa Alonso
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

[PHP] Date problems

2007-01-04 Thread Beauford
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)

Re: [PHP] Date problems

2007-01-04 Thread Stut
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

RE: [PHP] Date problems

2007-01-04 Thread Beauford
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

[PHP] date() and timezone

2006-12-14 Thread Fernando M. M.
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

Re: [PHP] date() and timezone

2006-12-14 Thread Jochem Maas
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

Re: [PHP] date() and timezone

2006-12-14 Thread Stut
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

Re: [PHP] date() and timezone

2006-12-14 Thread Fernando M. M.
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

Re: [PHP] date() and timezone

2006-12-14 Thread Jochem Maas
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

[PHP] date formatting - no question here just a tip ...

2006-12-14 Thread Jochem Maas
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

RE: [PHP] date() function

2006-11-15 Thread Ivo F.A.C. Fokkema
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,

[PHP] date() function

2006-11-14 Thread Ashley M. Kirchner
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

RE: [PHP] date() function

2006-11-14 Thread Brad Fuller
$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

[PHP] Date calculation

2006-10-15 Thread Ron Piggott (PHP)
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

Re: [PHP] Date calculation

2006-10-15 Thread Travis Doherty
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

[PHP] Date verification

2006-10-09 Thread Ron Piggott (PHP)
Is there a PHP function which verifies a valid date has been entered (-MM-DD)? Ron

Re: [PHP] Date verification

2006-10-09 Thread Arpad Ray
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:

Re: [PHP] Date verification

2006-10-09 Thread Max Belushkin
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

Re: [PHP] Date verification

2006-10-09 Thread Richard Lynch
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

Re: [PHP] Date maths

2006-09-11 Thread tedd
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

[PHP] Date maths

2006-09-10 Thread Dave Goodchild
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).

Re: [PHP] Date maths

2006-09-10 Thread Paul Scott
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

[PHP] date(n/Y) strtotime

2006-08-02 Thread Mark Steudel
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

RE: [PHP] date(n/Y) strtotime

2006-08-02 Thread Mark Steudel
: [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

RE: [PHP] date(n/Y) strtotime

2006-08-02 Thread Mark Steudel
{ 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

Re: [PHP] date(n/Y) strtotime

2006-08-02 Thread Adam Zey
' ) { 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

RE: [PHP] date(n/Y) strtotime

2006-08-02 Thread Mark Steudel
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

Re: [PHP] date(n/Y) strtotime

2006-08-02 Thread Adam Zey
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

RE: [PHP] date iteration

2006-05-24 Thread Jef Sullivan
,$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

[PHP] date iteration

2006-05-23 Thread Dave Goodchild
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:

Re: [PHP] date iteration

2006-05-23 Thread Rabin Vincent
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

Re: [PHP] date iteration

2006-05-23 Thread Richard Lynch
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

FW: [PHP] Date() finding yesterday

2006-05-22 Thread Jef Sullivan
] 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

Re: [PHP] Date() finding yesterday

2006-05-21 Thread Scott Hurring
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-) .

[PHP] Date() finding yesterday

2006-05-20 Thread John Taylor-Johnston
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

Re: [PHP] Date() finding yesterday

2006-05-20 Thread Rabin Vincent
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

Re: [PHP] Date time Comparison

2006-04-19 Thread John Wells
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

[PHP] Date time Comparison

2006-04-18 Thread Murtaza Chang
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){

Re: [PHP] Date time Comparison

2006-04-18 Thread Richard Lynch
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:

Re: [PHP] Date problems

2006-04-09 Thread Satyam
); 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

Re: [PHP] Date problems

2006-04-09 Thread Rasmus Lerdorf
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

[PHP] Date problems

2006-04-08 Thread Mace Eliason
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

Re: [PHP] Date problems

2006-04-08 Thread Rasmus Lerdorf
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

Re: [PHP] Date problems

2006-04-08 Thread Rasmus Lerdorf
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)));

[PHP] Date addition problem

2006-03-29 Thread Adrian Bruce
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

Re: [PHP] Date addition problem

2006-03-29 Thread Thomas Munz
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

Re: [PHP] Date addition problem

2006-03-29 Thread Adrian Bruce
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

Re: [PHP] Date addition problem

2006-03-29 Thread Adrian Bruce
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 =

RE: [PHP] Date addition problem

2006-03-29 Thread Ford, Mike
-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

Re: [PHP] Date addition problem

2006-03-29 Thread tedd
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);

RE: [PHP] Date addition problem

2006-03-29 Thread Weber Sites LTD
: 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

[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 from YYYY-MM-DD to current date

2006-03-15 Thread Dan McCullough
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

RE: [PHP] date from YYYY-MM-DD to current date

2006-03-15 Thread Shaunak Kashyap
@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

[PHP] RE: [SOLVED] [PHP] date from YYYY-MM-DD to current date

2006-03-15 Thread Shaunak Kashyap
. -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] Re: [SOLVED] [PHP] date from YYYY-MM-DD to current date

2006-03-15 Thread Dan McCullough
: [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

[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

<    1   2   3   4   5   6   7   8   9   10   >