[PHP] Date Comparison

2009-08-28 Thread David Stoltz
How to I ensure a variable date is not in the past, compared to the current date? Here's how I'm trying, unsuccessfully: $nextdate = 8/2/2009; if(strtotime($nextdate)=getdate()){ echo Sorry, your next evaluation date cannot be in the past, Click BACK to continue.; exit;

Re: [PHP] Date Comparison

2009-08-28 Thread Stuart
2009/8/28 David Stoltz dsto...@shh.org: How to I ensure a variable date is not in the past, compared to the current date? Here's how I'm trying, unsuccessfully: $nextdate = 8/2/2009; if(strtotime($nextdate)=getdate()){        echo Sorry, your next evaluation date cannot be in the past,

Re: [PHP] Date Comparison

2009-08-28 Thread tedd
At 10:12 AM -0400 8/28/09, David Stoltz wrote: How to I ensure a variable date is not in the past, compared to the current date? Here's how I'm trying, unsuccessfully: $nextdate = 8/2/2009; if(strtotime($nextdate)=getdate()){ echo Sorry, your next evaluation date cannot be in the

RE: [PHP] Date Comparison

2009-08-28 Thread David Stoltz
[mailto:stut...@gmail.com] Sent: Friday, August 28, 2009 10:19 AM To: David Stoltz Cc: php-general@lists.php.net Subject: Re: [PHP] Date Comparison 2009/8/28 David Stoltz dsto...@shh.org: How to I ensure a variable date is not in the past, compared to the current date? Here's how I'm trying

[PHP] date time late or lagging

2009-04-28 Thread Andrew Williams
hi all, $dateNow = date('Y-m-d H:i:s'); echo pstrong.$dateNow ./strong/p; can some see why the date time is lagging or late by 30 minutes from the server time even when server time are correct

Re: [PHP] date time late or lagging RESOLVED

2009-04-28 Thread Andrew Williams
On Tue, Apr 28, 2009 at 3:45 PM, Andrew Williams andrew4willi...@gmail.comwrote: hi all, $dateNow = date('Y-m-d H:i:s'); echo pstrong.$dateNow ./strong/p; can some see why the date time is lagging or late by 30 minutes from the server time even when server time are correct -- Best

[PHP] DATE / strtotime

2009-04-19 Thread Ron Piggott
Where $date_reference is 2009-04-18 the following code gives me a day of 1969-12-30. How do I get it to be 2009-04-17? $previous_date = strtotime(-1 days, $date_reference); $previous_date = date('Y-m-d', $previous_date); echo $previous_date; outputs 1969-12-30 Ron

Re: [PHP] DATE / strtotime

2009-04-19 Thread Chris
Ron Piggott wrote: Where $date_reference is 2009-04-18 the following code gives me a day of 1969-12-30. How do I get it to be 2009-04-17? $previous_date = strtotime(-1 days, $date_reference); $previous_date = date('Y-m-d', $previous_date); Slightly wrong syntax. $previous_date =

Re: [PHP] DATE / strtotime

2009-04-19 Thread Jim Lucas
Ron Piggott wrote: Where $date_reference is 2009-04-18 the following code gives me a day of 1969-12-30. How do I get it to be 2009-04-17? $previous_date = strtotime(-1 days, $date_reference); $previous_date = date('Y-m-d', $previous_date); echo $previous_date; outputs 1969-12-30 Ron

Re: [PHP] DATE / strtotime

2009-04-19 Thread Ron Piggott
Thanks Chris. It has been a while since I used this command. Ron On Mon, 2009-04-20 at 13:27 +1000, Chris wrote: Ron Piggott wrote: Where $date_reference is 2009-04-18 the following code gives me a day of 1969-12-30. How do I get it to be 2009-04-17? $previous_date = strtotime(-1

Re: [PHP] Date Issue

2008-11-18 Thread Andrew Ballard
-general@lists.php.net Subject: Re: [PHP] Date Issue Boyd, Todd M. wrote: Are you sure this isn't like Javascript's getMonth function? Its index may begin at 0, making day 0 the first day of the year. Hmm, though I know us programmers love to start counting at zero, why would

Re: [PHP] Date Issue

2008-11-18 Thread Ashley Sheridan
, 2008 4:50 PM To: Boyd, Todd M. Cc: [EMAIL PROTECTED]; php-general@lists.php.net Subject: Re: [PHP] Date Issue Boyd, Todd M. wrote: Are you sure this isn't like Javascript's getMonth function? Its index may begin at 0, making day 0 the first day of the year. Hmm, though

Re: [PHP] Date Issue

2008-11-18 Thread Andrew Ballard
On Tue, Nov 18, 2008 at 2:58 PM, Ashley Sheridan [EMAIL PROTECTED] wrote: It just flew in the face of all I knew at the time to have a non-associative system-generated array (by that I mean one whos keys are integars and not string keys) that doesn't start at 0. No other arrays defined in

[PHP] Date Issue

2008-11-17 Thread admin
$smont = 10; $sday = 13; $syear = 2008; $timestamp = mktime(0,0,0,$smont,$sday,$syear); $thismonth = getdate($timestamp); Here is where the problem comes into play. echo $thismonth['yday']; This displays 286 when in fact its 287. Is there a problem in my ini file or what is the deal. -- PHP

RE: [PHP] Date Issue

2008-11-17 Thread Boyd, Todd M.
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 10:50 AM To: php-general@lists.php.net Subject: [PHP] Date Issue $smont = 10; $sday = 13; $syear = 2008; $timestamp = mktime(0,0,0,$smont,$sday,$syear); $thismonth = getdate

Re: [PHP] Date Issue

2008-11-17 Thread Nathan Rixham
Boyd, Todd M. wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 10:50 AM To: php-general@lists.php.net Subject: [PHP] Date Issue $smont = 10; $sday = 13; $syear = 2008; $timestamp = mktime(0,0,0,$smont,$sday,$syear); $thismonth

Re: [PHP] Date Issue

2008-11-17 Thread Craige Leeder
Boyd, Todd M. wrote: Are you sure this isn't like Javascript's getMonth function? Its index may begin at 0, making day 0 the first day of the year. HTH, Todd Boyd Web Programmer Hmm, though I know us programmers love to start counting at zero, why would something as static as a date

RE: [PHP] Date Issue

2008-11-17 Thread Boyd, Todd M.
-Original Message- From: Craige Leeder [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 4:50 PM To: Boyd, Todd M. Cc: [EMAIL PROTECTED]; php-general@lists.php.net Subject: Re: [PHP] Date Issue Boyd, Todd M. wrote: Are you sure this isn't like Javascript's getMonth

RE: [PHP] Date Issue

2008-11-17 Thread Ashley Sheridan
On Mon, 2008-11-17 at 16:57 -0600, Boyd, Todd M. wrote: -Original Message- From: Craige Leeder [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 4:50 PM To: Boyd, Todd M. Cc: [EMAIL PROTECTED]; php-general@lists.php.net Subject: Re: [PHP] Date Issue Boyd, Todd M

[PHP] Date formatting issue

2008-08-05 Thread Don Don
Hi all, I've got dates in the following formats e.g. August 05, 2008, 10:14 am (e.g. today's date) August 04, 2008, 7:08 am (e.g. yesterda's date) August 03, 2008, 9:08 am (e.g. in the past) I am trying to format these dates do I can display them like this Today at 10:14 am (today) Yesterday

Re: [PHP] Date formatting issue

2008-08-05 Thread Dan Joseph
On Tue, Aug 5, 2008 at 11:48 AM, Don Don [EMAIL PROTECTED] wrote: Hi all, I've got dates in the following formats e.g. August 05, 2008, 10:14 am (e.g. today's date) August 04, 2008, 7:08 am (e.g. yesterda's date) August 03, 2008, 9:08 am (e.g. in the past) I am trying to format these

Re: [PHP] Date formatting issue

2008-08-05 Thread Daniel Brown
On Tue, Aug 5, 2008 at 11:48 AM, Don Don [EMAIL PROTECTED] wrote: Hi all, I've got dates in the following formats e.g. August 05, 2008, 10:14 am (e.g. today's date) August 04, 2008, 7:08 am (e.g. yesterda's date) August 03, 2008, 9:08 am (e.g. in the past) I am trying to format these

[PHP] date() and strtotime()

2008-07-11 Thread Fabian Frei
Hello everybody, I hope you all have a nice day, mines not that good 'cause i have encountered a strange problem. i have a few functions to work with dates. they are all very simple, a few lines of code. this first one does just gives you the monday of the current week: function

Re: [PHP] date() and strtotime()

2008-07-11 Thread Bastien Koert
On Fri, Jul 11, 2008 at 9:03 AM, Fabian Frei [EMAIL PROTECTED] wrote: Hello everybody, I hope you all have a nice day, mines not that good 'cause i have encountered a strange problem. i have a few functions to work with dates. they are all very simple, a few lines of code. this first one

[PHP] Date comparison Question

2008-04-07 Thread admin
I am having a date time comparison issue. I have statically set the values here. But the data is fed from the database, CaldTime is timestamp and since it will not allow me to have 2 timestamps in the same table I set the CallEnd varchar(12). Storing the data they seem to be the same for

Re: [PHP] Date comparison Question

2008-04-07 Thread Nathan Nobbe
On Mon, Apr 7, 2008 at 9:42 AM, [EMAIL PROTECTED] wrote: I am having a date time comparison issue. I have statically set the values here. But the data is fed from the database, CaldTime is timestamp and since it will not allow me to have 2 timestamps in the same table I set the CallEnd

Re: [PHP] Date comparison Question

2008-04-07 Thread Mark J. Reed
On Mon, Apr 7, 2008 at 11:42 AM, [EMAIL PROTECTED] wrote: t the data is fed from the database, CaldTime is timestamp and since it will not allow me to have 2 timestamps in the same table ?? What database are you using? It sounds like it has a specific meaning of timestamp - probably the last

Re: [PHP] Date comparison Question

2008-04-07 Thread admin
Yes my mistake was looking at another record and published another. But I figured it out now i can publish 1:45 like i wanted. Having a moment there. Thank you Richard L. Buskirk    On Mon, Apr 7, 2008 at 9:42 AM, [EMAIL PROTECTED] wrote: I am having a date time comparison issue. I have

Re: [PHP] Date comparison Question

2008-04-07 Thread admin
Thank you that is exactly what i did to figure it out. Just was having a brain fart there for a minute. On Mon, Apr 7, 2008 at 11:42 AM, [EMAIL PROTECTED] wrote: t the data is fed from the database, CaldTime is timestamp and since it will not allow me to have 2 timestamps in the same table

Re: [PHP] Date comparison Question

2008-04-07 Thread Daniel Brown
On Mon, Apr 7, 2008 at 11:42 AM, [EMAIL PROTECTED] wrote: I am having a date time comparison issue. I have statically set the values here. But the data is fed from the database, CaldTime is timestamp and since it will not allow me to have 2 timestamps in the same table I set the CallEnd

Re: [PHP] Date comparison Question

2008-04-07 Thread admin
Dan I made a solution as below. $time1 = strtotime($sqldata[CaldTime]); $time2 = strtotime($sqldata[CallEnd]); $interval = $time2 - $time1; $TLength = date(i:s, strtotime(2008-01-01 01:00:$interval)); Result 01:45 Works perfect for me. Do you agree or disagree dan? On Mon, Apr 7, 2008 at

Re: [PHP] Date comparison Question

2008-04-07 Thread Daniel Brown
On Mon, Apr 7, 2008 at 1:03 PM, [EMAIL PROTECTED] wrote: Dan I made a solution as below. $time1 = strtotime($sqldata[CaldTime]); $time2 = strtotime($sqldata[CallEnd]); $interval = $time2 - $time1; $TLength = date(i:s, strtotime(2008-01-01 01:00:$interval)); Result 01:45 Works

Re: [PHP] date CDT CST UTC

2008-04-07 Thread Dee Ayy
Daylight Savings Time must die! Oh, by the way, thanks for your reply. So last night my clock went forward an hour on this cool DST-aware dual alarm clock radio I bought in 1999. Apparently DST rules have changed http://en.wikipedia.org/wiki/Year_2007_problem so now my clock isn't as cool

Re: [PHP] Date Issue

2008-04-01 Thread admin
Your doing the same thing i did look at date(d) When its the 31 like yesteday of course it can not find the 31 of months that do not have them. Thats why it errored. String worked up till monday which explained alot. I just did not look at what i was doing. changed the code to $zomonth =

Re: [PHP] Date Issue

2008-04-01 Thread Richard Lynch
I generally use 1 hour after midnight with mktime() to avoid the edge cases of daylight savings etc... mktime(1, 0, 0, date('m') - 1, date('d'), date('Y')); You also have to consider that you *COULD* call this right on the cusp of midnight, and the call to date('d') could happen one day, and the

Re: [PHP] Date Issue

2008-04-01 Thread Richard Lynch
If you want the DAY before, you can use the -1 for the day, and get what you want. mktime() will wrap the month as needed. But, yeah, if you try to hit a MONTH before by putting in a month before AND the day, it will slingshot back and forth to get what you don't want. If you want the MONTH

[PHP] Date Issue

2008-03-31 Thread admin
Not understanding why this is happening. $month = date(F, mktime(0,0,0, date(m), date(d), date(Y))); $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d), date(Y))); echoing out the exact same month March March Checked server timezone/date/time all is good. Am I half asleep at the wheel on

Re: [PHP] Date Issue

2008-03-31 Thread Andrew Ballard
On Mon, Mar 31, 2008 at 3:07 PM, [EMAIL PROTECTED] wrote: Not understanding why this is happening. $month = date(F, mktime(0,0,0, date(m), date(d), date(Y))); $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d), date(Y))); echoing out the exact same month March March Checked

Re: [PHP] Date Issue

2008-03-31 Thread Richard Lynch
You need apostrophes (or quotes) around your args to date() in the parameters... date('m') As it stands now, PHP assumes you mean the constant m (http://php.net/define) and that's not defined, so they are all 0. So you are passing in 0 to ALL the args. You also should use E_ALL for your

Re: [PHP] Date Issue

2008-03-31 Thread admin
I tried that a big no go. Seems if I do a +1 i get 2 months from now and a -1 gives me the current month. $month = date(F, mktime(0,0,0, date('m'), date('d'), date('Y'))); $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d), date(Y))); $nmonth = date(F, mktime(0,0,0, date(m)+1, date(d),

Re: [PHP] Date Issue

2008-03-31 Thread Daniel Brown
On Mon, Mar 31, 2008 at 4:15 PM, [EMAIL PROTECTED] wrote: I tried that a big no go. Seems if I do a +1 i get 2 months from now and a -1 gives me the current month. $month = date(F, mktime(0,0,0, date('m'), date('d'), date('Y'))); $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d),

Re: [PHP] Date Issue

2008-03-31 Thread Dan Joseph
On Mon, Mar 31, 2008 at 3:15 PM, [EMAIL PROTECTED] wrote: I tried that a big no go. Seems if I do a +1 i get 2 months from now and a -1 gives me the current month. $month = date(F, mktime(0,0,0, date('m'), date('d'), date('Y'))); $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d),

Re: [PHP] Date Issue

2008-03-31 Thread Andrew Ballard
On Mon, Mar 31, 2008 at 4:15 PM, [EMAIL PROTECTED] wrote: I tried that a big no go. Seems if I do a +1 i get 2 months from now and a -1 gives me the current month. Like I said, mktime makes corrections for otherwise invalid dates. Today is March 31. Moving the month number back by one (-1)

Re: [PHP] Date Issue

2008-03-31 Thread admin
Thank you again Dan. Thought never crossed my mind the day being the 31st. That fixed it. Richard L. Buskirk On Mon, Mar 31, 2008 at 4:15 PM, [EMAIL PROTECTED] wrote: I tried that a big no go. Seems if I do a +1 i get 2 months from now and a -1 gives me the current month.

Re: [PHP] Date Issue

2008-03-31 Thread Andrew Ballard
On Mon, Mar 31, 2008 at 4:15 PM, [EMAIL PROTECTED] wrote: I tried that a big no go. Seems if I do a +1 i get 2 months from now and a -1 gives me the current month. $month = date(F, mktime(0,0,0, date('m'), date('d'), date('Y'))); $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d),

Re: [PHP] Date Issue

2008-03-31 Thread Daniel Brown
On Mon, Mar 31, 2008 at 4:24 PM, [EMAIL PROTECTED] wrote: Thank you again Dan. Thought never crossed my mind the day being the 31st. That fixed it. Thank Andrew Ballard, actually. He said it even before I did. I'm getting slow in my old age! ;-P -- /Daniel P. Brown Forensic

Re: [PHP] Date math

2008-03-26 Thread Richard Lynch
On Sun, March 23, 2008 11:17 pm, Ron Piggott wrote: I have this math equation this list helped me generate a few weeks ago. The purpose is to calculate how many days have passed between 2 dates. Right now my output ($difference) is 93.958333 days. I am finding this a little weird. Does

[PHP] date CDT CST UTC

2008-03-26 Thread Dee Ayy
update the clock) shows the email header as Mon, 10 Mar 2008 14:35:44 -0500 and in the email client without looking at raw source as Date: March 10, 2008 2:35:44 PM CDT, but the body of the email (which used PHP date(Y-m-d H:i:s)) shows 2008-03-10 13:35:44. Note 13 instead of 14. I've asked the admin

Re: [PHP] date CDT CST UTC

2008-03-26 Thread Richard Lynch
to daylight savings time on 3/10 and I'm sure our admin had to manually update the clock) shows the email header as Mon, 10 Mar 2008 14:35:44 -0500 and in the email client without looking at raw source as Date: March 10, 2008 2:35:44 PM CDT, but the body of the email (which used PHP date(Y-m-d H:i:s

Re: [PHP] Date math

2008-03-25 Thread Ron Piggott
Could someone then help me modify the PHP script so I won't have this timezone issue? I don't understand from looking at the date page on the PHP web site the change(s) I need to make. Thanks, Ron ? $date1 = strtotime($date1); $date2 = strtotime($date2); $factor = 86400; $difference =

Re: [PHP] Date math

2008-03-25 Thread Casey
(top-posting!) Add either the round function or ceil function. On Mar 25, 2008, at 6:47 AM, Ron Piggott [EMAIL PROTECTED] wrote: Could someone then help me modify the PHP script so I won't have this timezone issue? I don't understand from looking at the date page on the PHP web site

Re: [PHP] Date math

2008-03-24 Thread Jim Lucas
Ron Piggott wrote: I have this math equation this list helped me generate a few weeks ago. The purpose is to calculate how many days have passed between 2 dates. Right now my output ($difference) is 93.958333 days. I am finding this a little weird. Does anyone see anything wrong with

[PHP] Date math

2008-03-23 Thread Ron Piggott
I have this math equation this list helped me generate a few weeks ago. The purpose is to calculate how many days have passed between 2 dates. Right now my output ($difference) is 93.958333 days. I am finding this a little weird. Does anyone see anything wrong with the way this is

Re: [PHP] Date math

2008-03-23 Thread Simon Welsh
On 24/03/2008, at 5:17, Ron Piggott wrote: I have this math equation this list helped me generate a few weeks ago. The purpose is to calculate how many days have passed between 2 dates. Right now my output ($difference) is 93.958333 days. I am finding this a little weird. Does anyone

Re: [PHP] Date math

2008-03-23 Thread Casey
On Sun, Mar 23, 2008 at 9:17 PM, Ron Piggott [EMAIL PROTECTED] wrote: I have this math equation this list helped me generate a few weeks ago. The purpose is to calculate how many days have passed between 2 dates. snip $date1 = strtotime($date1); (March 21st 2008) $date2 =

Re: [PHP] Date Function

2008-02-23 Thread Richard Heyes
$start_date = date(Y-m-d h:i:s, strtotime($date_format)); echo $start_date; ? output is 2008-02-22 02:00:00 but not 2008-02-22 14:00:00 How can i get my output as 2008-02-22 14:00:00. Use H instead of h. And try the manual. -- Richard Heyes http://www.phpguru.org Free PHP and Javascript

[PHP] Date Function

2008-02-22 Thread VamVan
Hi All, Greetings!! A small PHP Script for help ?php $date_format = '02/22/2008 14:00:00'; $start_date = date(Y-m-d h:i:s, strtotime($date_format)); echo $start_date; ? output is 2008-02-22 02:00:00 but not 2008-02-22 14:00:00 How can i get my output as 2008-02-22 14:00:00. Thanks V --

Re: [PHP] Date Function

2008-02-22 Thread Andrew Ballard
On Fri, Feb 22, 2008 at 2:48 PM, VamVan [EMAIL PROTECTED] wrote: Hi All, Greetings!! A small PHP Script for help ?php $date_format = '02/22/2008 14:00:00'; $start_date = date(Y-m-d h:i:s, strtotime($date_format)); echo $start_date; ? output is 2008-02-22 02:00:00 but not

Re: [PHP] Date Function

2008-02-22 Thread Zoltán Németh
2008. 02. 22, péntek keltezéssel 11.48-kor VamVan ezt írta: Hi All, Greetings!! A small PHP Script for help ?php $date_format = '02/22/2008 14:00:00'; $start_date = date(Y-m-d h:i:s, strtotime($date_format)); $start_date = date(Y-m-d H:i:s, strtotime($date_format)); RTFM:

RES: [PHP] Date Function

2008-02-22 Thread Thiago Pojda
$start_date = date(Y-m-d H:i:s, strtotime($date_format)); echo $start_date; ? capital H should do it -Mensagem original- De: VamVan [mailto:[EMAIL PROTECTED] Enviada em: sexta-feira, 22 de fevereiro de 2008 16:48 Para: php-general@lists.php.net Assunto: [PHP] Date Function Hi All

Re: [PHP] Date Function ][Resolved]

2008-02-22 Thread VamVan
: sexta-feira, 22 de fevereiro de 2008 16:48 Para: php-general@lists.php.net Assunto: [PHP] Date Function Hi All, Greetings!! A small PHP Script for help ?php $date_format = '02/22/2008 14:00:00'; $start_date = date(Y-m-d h:i:s, strtotime($date_format)); echo $start_date

Re: [PHP] date() and wrong timezone (or time)

2008-02-14 Thread Richard Lynch
On Wed, February 6, 2008 11:13 am, Martin Marques wrote: Nathan Nobbe escribió: On Feb 6, 2008 6:13 AM, Martin Marques [EMAIL PROTECTED] wrote: I got an update from tzdata on a Debian server due to a daylight saving change here in Argentina. The problem is that, even when the system sees

Re: [PHP] date() and wrong timezone (or time)

2008-02-07 Thread Jochem Maas
Martin Marques schreef: Nathan Nobbe escribió: On Feb 6, 2008 6:13 AM, Martin Marques [EMAIL PROTECTED] wrote: I got an update from tzdata on a Debian server due to a daylight saving change here in Argentina. I doubt that debian stable is pushing newer versions of TZ db, than that found

Re: [PHP] date() and wrong timezone (or time)

2008-02-07 Thread Daniel Brown
On Feb 7, 2008 8:34 AM, Jochem Maas [EMAIL PROTECTED] wrote: Martin Marques schreef: see what you have as the value for the date.timezone ini setting. I've already checked that, and it's not set. it should be set to something, so fix that. All other points being valid, Jochem, I

Re: [PHP] date() and wrong timezone (or time)

2008-02-07 Thread Eric Butera
On Feb 6, 2008 6:13 AM, Martin Marques [EMAIL PROTECTED] wrote: I got an update from tzdata on a Debian server due to a daylight saving change here in Argentina. The problem is that, even when the system sees the correct time, php keeps giving me the *old* hour. $ date mié feb 6 09:03:57

Re: [PHP] date() and wrong timezone (or time)

2008-02-07 Thread Martin Marques
Jochem Maas escribió: Martin Marques schreef: Nathan Nobbe escribió: On Feb 6, 2008 6:13 AM, Martin Marques [EMAIL PROTECTED] wrote: I got an update from tzdata on a Debian server due to a daylight saving change here in Argentina. I doubt that debian stable is pushing newer versions of TZ

Re: [PHP] date() and wrong timezone (or time)

2008-02-07 Thread David Giragosian
On 2/7/08, Daniel Brown [EMAIL PROTECTED] wrote: On Feb 7, 2008 8:34 AM, Jochem Maas [EMAIL PROTECTED] wrote: Martin Marques schreef: see what you have as the value for the date.timezone ini setting. I've already checked that, and it's not set. it should be set to something, so

Re: [PHP] date() and wrong timezone (or time)

2008-02-07 Thread Jochem Maas
Daniel Brown schreef: On Feb 7, 2008 8:34 AM, Jochem Maas [EMAIL PROTECTED] wrote: Martin Marques schreef: see what you have as the value for the date.timezone ini setting. I've already checked that, and it's not set. it should be set to something, so fix that. All other points being

[PHP] date() and wrong timezone (or time)

2008-02-06 Thread Martin Marques
I got an update from tzdata on a Debian server due to a daylight saving change here in Argentina. The problem is that, even when the system sees the correct time, php keeps giving me the *old* hour. $ date mié feb 6 09:03:57 ARST 2008 $ echo ?php echo date('H:i') . \\n\; ?|php5 08:04 What

Re: [PHP] date() and wrong timezone (or time)

2008-02-06 Thread Nathan Nobbe
On Feb 6, 2008 6:13 AM, Martin Marques [EMAIL PROTECTED] wrote: I got an update from tzdata on a Debian server due to a daylight saving change here in Argentina. The problem is that, even when the system sees the correct time, php keeps giving me the *old* hour. $ date mié feb 6 09:03:57

Re: [PHP] date() and wrong timezone (or time)

2008-02-06 Thread Martin Marques
Nathan Nobbe escribió: On Feb 6, 2008 6:13 AM, Martin Marques [EMAIL PROTECTED] wrote: I got an update from tzdata on a Debian server due to a daylight saving change here in Argentina. The problem is that, even when the system sees the correct time, php keeps giving me the *old* hour. $ date

Re: [PHP] date() and wrong timezone (or time)

2008-02-06 Thread Nathan Nobbe
On Feb 6, 2008 12:13 PM, Martin Marques [EMAIL PROTECTED] wrote: see what you have as the value for the date.timezone ini setting. I've already checked that, and it's not set. then you should probly set it ;) Anyway, I found out that PHP uses an internal tz database (very bad IMHO) and it

Re: [PHP] date() and wrong timezone (or time)

2008-02-06 Thread Martin Marques
Nathan Nobbe escribió: On Feb 6, 2008 12:13 PM, Martin Marques [EMAIL PROTECTED] wrote: see what you have as the value for the date.timezone ini setting. I've already checked that, and it's not set. then you should probly set it ;) It has the right TZ set. I checked it with

Re: [PHP] date() and wrong timezone (or time)

2008-02-06 Thread Andrew Ballard
On Feb 6, 2008 12:48 PM, Martin Marques [EMAIL PROTECTED] wrote: Nathan Nobbe escribió: On Feb 6, 2008 12:13 PM, Martin Marques [EMAIL PROTECTED] wrote: see what you have as the value for the date.timezone ini setting. I've already checked that, and it's not set. then you should

Re: [PHP] PHP date: ISO year = loss of hair

2007-12-14 Thread tedd
At 10:02 AM +0200 12/14/07, Arno Kuhl wrote: I'm battling with getting the last week number using date(W, $unixdate). If the date is 30 December 2007 ($unixdate=1198965600) Not accordingly to my calculations -- try it: http://webbytedd.com/c/unix-time/ Cheers, tedd -- ---

RE: [PHP] PHP date: ISO year = loss of hair

2007-12-14 Thread Arno Kuhl
-Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: 14 December 2007 04:50 To: [EMAIL PROTECTED]; php-general@lists.php.net Cc: Arno Kuhl Subject: Re: [PHP] PHP date: ISO year = loss of hair At 10:02 AM +0200 12/14/07, Arno Kuhl wrote: I'm battling with getting the last week

Re: [PHP] PHP date: ISO year = loss of hair

2007-12-14 Thread Andrew Ballard
missed about PHP date? Any pointers would be greatly appreciated. Thanks Arno If the last week of the year is the one that has Dec. 28 in it, and the last week number is 52, then Dec. 30 SHOULD return 1. Dec. 30 is not in the 53rd week of 2007; it is in the first week of 2008 according

RE: [PHP] PHP date: ISO year = loss of hair

2007-12-14 Thread Arno Kuhl
-Original Message- From: Andrew Ballard [mailto:[EMAIL PROTECTED] Sent: 14 December 2007 04:38 To: PHP General list Subject: Re: [PHP] PHP date: ISO year = loss of hair If the last week of the year is the one that has Dec. 28 in it, and the last week number is 52, then Dec. 30 SHOULD

Re: [PHP] PHP date: ISO year = loss of hair

2007-12-14 Thread Richard Lynch
missed about PHP date? Any pointers would be greatly appreciated. I think Arlo Leach fought this battle and posted here or in the Chicago PHP User Group about it... You should be able to find PHP-General archives easily enough. The Chicago group ones are here: http://sourceforge.net/mailarchive

[PHP] PHP date: ISO year = loss of hair

2007-12-13 Thread Arno Kuhl
and the date to see if a Sunday occurs and if so add one to the week number. It looks like it will work but seems ridiculously laboured for such a simple issue. Am I overlooking something obvious here - is there something I've missed about PHP date? Any pointers would be greatly appreciated. Thanks

[PHP] date weirdness

2007-09-18 Thread Greg Donald
I have extracted a small portion of a calendar application I developed recently to show some strange behavior with the date() function. When I run this I get duplicate dates occasionally down the list. I'm seeing 11/4 twice for example. Sometimes dates are missing from the list. The results

Re: [PHP] date weirdness

2007-09-18 Thread Andrew Ballard
I'm seeing 11/4 twice for example. Sometimes dates are missing from the list. The results change from day to day. That would be DST. The number of seconds per day changes on Nov. 4, 2007 in the US local time zones. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] date weirdness

2007-09-18 Thread Robert Cummings
On Tue, 2007-09-18 at 15:32 -0500, Greg Donald wrote: I have extracted a small portion of a calendar application I developed recently to show some strange behavior with the date() function. When I run this I get duplicate dates occasionally down the list. I'm seeing 11/4 twice for example.

[PHP] date formatting

2007-08-29 Thread Mike Ryan
I would like to have my users input the date formate as mm-dd- mysql wants the data to come down as -mm-dd. The question I have is how do I convert from the mm-dd- to -mm-dd so that I can write it out to the database? -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] date formatting

2007-08-29 Thread Wolf
Just have your input form get it in sections, then piece it all together when dumping it to MySQL This way you can transparent the code on the front to users, but have it in the right format in the backend. Mike Ryan [EMAIL PROTECTED] wrote: I would like to have my users input the date

Re: [PHP] date formatting

2007-08-29 Thread Richard Lynch
On Wed, August 29, 2007 4:12 pm, Mike Ryan wrote: I would like to have my users input the date formate as mm-dd- mysql wants the data to come down as -mm-dd. The question I have is how do I convert from the mm-dd- to -mm-dd so that I can write it out to the database? You

[PHP] Date Problem with \n

2007-08-13 Thread Kevin Murphy
Small issue with formatting a date. If I type in this: echo date(g:i:s a \o\n l F j, Y); the n character in the word on doesn't appear, but instead what I get is a new line in the source code. If I type it as: echo date(g:i:s a \on l F j, Y); I get the number 8 (current month) where the n

Re: [PHP] Date Problem with \n

2007-08-13 Thread Jim Lucas
Kevin Murphy wrote: Small issue with formatting a date. If I type in this: echo date(g:i:s a \o\n l F j, Y); the n character in the word on doesn't appear, but instead what I get is a new line in the source code. If I type it as: echo date(g:i:s a \on l F j, Y); I get the number 8 (current

Re: [PHP] Date Problem with \n

2007-08-13 Thread Richard Lynch
On Mon, August 13, 2007 12:50 pm, Kevin Murphy wrote: Small issue with formatting a date. If I type in this: echo date(g:i:s a \o\n l F j, Y); the n character in the word on doesn't appear, but instead what I get is a new line in the source code. If I type it as: echo date(g:i:s a \on l F

Re: [PHP] Date Calculation Help

2007-07-02 Thread Fredrik Thunberg
$q = ceil( month / 4 ); -- /Thunis The ships hung in the sky in much the same way that bricks don't. --The Hitchikers Guide to the Galaxy revDAVE skrev: I have segmented a year into four quarters (3 months each) nowdate = the month of the chosen date (ex: 5-30-07 = month 5) Q: What is the

Re: [PHP] Date Calculation Help

2007-07-02 Thread Fredrik Thunberg
of course ceil( month / 3 ); -- /Thunis Don't panic. --The Hitchikers Guide to the Galaxy Fredrik Thunberg skrev: $q = ceil( month / 4 ); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Date Calculation Help

2007-07-02 Thread Dan
Well then after or before that you have to check that the month value is between 1 and 12 to make sure there's no input errors, then what if you ever want ot change the quarters yeah anway I just wanted an excuse to tell people to go low tech and use a switch, it's only 12 entries, and you

Re: [PHP] Date Calculation Help

2007-07-02 Thread Richard Lynch
If the date is coming from a database, there might be a function/format already for that... And http://php.net/date may also have a format specifier for Quarter. If not, try this: $quarter = ((int) ($month / 4)) + 1; On Sat, June 30, 2007 10:14 am, revDAVE wrote: I have segmented a year into

[PHP] Date Calculation Help

2007-06-30 Thread revDAVE
I have segmented a year into four quarters (3 months each) nowdate = the month of the chosen date (ex: 5-30-07 = month 5) Q: What is the best way to calculate which quarter (1-2-3 or 4) the chosen date falls on? Result - Ex: 5-30-07 = month 5 and should fall in quarter 2 -- Thanks - RevDave

Re: [PHP] Date Calculation Help

2007-06-30 Thread Paul Novitski
At 6/30/2007 08:14 AM, revDAVE wrote: I have segmented a year into four quarters (3 months each) nowdate = the month of the chosen date (ex: 5-30-07 = month 5) Q: What is the best way to calculate which quarter (1-2-3 or 4) the chosen date falls on? Result - Ex: 5-30-07 = month 5 and should

[PHP] Date

2007-06-20 Thread Ron Piggott
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 = ;

Re: [PHP] Date

2007-06-20 Thread Stut
Ron Piggott wrote: 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 = ; Depends what $start_date looks like. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

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 = ; Can you give us an example of $start_date? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Date

2007-06-20 Thread Zoltán Németh
2007. 06. 20, szerda keltezéssel 09.35-kor Ron Piggott ezt írta: 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 = ; depends on what format do you have $start_date in if you have something like

Re: [PHP] Date

2007-06-20 Thread Fredrik Thunberg
Ron Piggott skrev: 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 = ; Of course depending on what $start_date looks like, but this should work most of the time: $timestamp = strtotime( $start_date

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