Re: [PHP] Time out issue

2012-05-12 Thread Matijn Woudt
On Sat, May 12, 2012 at 9:42 PM, admin ad...@buskirkgraphics.com wrote:
 I am running Windows 2008 R2, IIS 7

 I am running into an issue where no matter what I set the script  time out
 to be the server is

 Giving me a 500 error  after like 60 seconds when the process exceeds the
 configured activity timeout.



 Here is the example script

 ?

 set_time_limit(120);

 sleep(100);

 Echo PASSED THE TIME OUT;

 ?



 I fully understand this may not be a PHP error but if anyone has ran into
 this issue with a windows server and

 can explain in detail how I can adjust the timeout, I would be very
 grateful.

 Everything I have read online points to a fcgiext.ini file that does not
 exist on my server.



 Anyone know how to help ?


Didn't use windows server in about 10 years (Go linux ;)), but did you try this?

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/44ebc761-ac76-4b44-8894-551c9315af6c.mspx

- Matijn

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Time out issue

2012-05-12 Thread admin


-Original Message-
From: Matijn Woudt [mailto:tijn...@gmail.com] 
Sent: Saturday, May 12, 2012 3:54 PM
To: admin
Cc: php-general@lists.php.net
Subject: Re: [PHP] Time out issue

On Sat, May 12, 2012 at 9:42 PM, admin ad...@buskirkgraphics.com wrote:
 I am running Windows 2008 R2, IIS 7

 I am running into an issue where no matter what I set the script  time 
 out to be the server is

 Giving me a 500 error  after like 60 seconds when the process exceeds 
 the configured activity timeout.



 Here is the example script

 ?

 set_time_limit(120);

 sleep(100);

 Echo PASSED THE TIME OUT;

 ?



 I fully understand this may not be a PHP error but if anyone has ran 
 into this issue with a windows server and

 can explain in detail how I can adjust the timeout, I would be very 
 grateful.

 Everything I have read online points to a fcgiext.ini file that does 
 not exist on my server.



 Anyone know how to help ?


Didn't use windows server in about 10 years (Go linux ;)), but did you try this?

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/44ebc761-ac76-4b44-8894-551c9315af6c.mspx

- Matijn

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
http://www.php.net/unsub.php


I had to get Microsoft on the phone to resolve this issue with IIS and FAST-CGI 
seems you can adjust the 
Request Timeout and Activity Timeout within the IIS manager and for some reason 
no documentation leads you to this point.

Sorry to bother issue resolved.










--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time out issue

2012-05-12 Thread Matijn Woudt
On Sat, May 12, 2012 at 10:19 PM, admin ad...@buskirkgraphics.com wrote:


 -Original Message-
 From: Matijn Woudt [mailto:tijn...@gmail.com]
 Sent: Saturday, May 12, 2012 3:54 PM
 To: admin
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] Time out issue

 On Sat, May 12, 2012 at 9:42 PM, admin ad...@buskirkgraphics.com wrote:
 I am running Windows 2008 R2, IIS 7

 I am running into an issue where no matter what I set the script  time
 out to be the server is

 Giving me a 500 error  after like 60 seconds when the process exceeds
 the configured activity timeout.



 Here is the example script

 ?

 set_time_limit(120);

 sleep(100);

 Echo PASSED THE TIME OUT;

 ?



 I fully understand this may not be a PHP error but if anyone has ran
 into this issue with a windows server and

 can explain in detail how I can adjust the timeout, I would be very
 grateful.

 Everything I have read online points to a fcgiext.ini file that does
 not exist on my server.



 Anyone know how to help ?


 Didn't use windows server in about 10 years (Go linux ;)), but did you try 
 this?

 http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/44ebc761-ac76-4b44-8894-551c9315af6c.mspx

 - Matijn

 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
 http://www.php.net/unsub.php


 I had to get Microsoft on the phone to resolve this issue with IIS and 
 FAST-CGI seems you can adjust the
 Request Timeout and Activity Timeout within the IIS manager and for some 
 reason no documentation leads you to this point.

 Sorry to bother issue resolved.


Again, Go linux.. Hehehe ;)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time/task reporting

2012-03-01 Thread Fatih P.
On Thu, Mar 1, 2012 at 10:43 AM, Robert Nilsson rob...@myself.com wrote:

 Hi,
  Ok, I admit -I'm lazy!
  Been asked to make a reporting tool, what and how many hours spent on
  Possible with a save option, to enable continuously adding during the
 week, before sending off by mail to manager and one self.

  Surely I'm not the first person looking at a similar tool, been searching
 a bit but not found example code to use for adjustment to suite my group
 needs.

  Anyone care to share or point me to a site where I can find this?

  Thanks


hey, there is something called project hamster for gnome. might give you an
idea:

http://live.gnome.org/ProjectHamster
http://projecthamster.wordpress.com/
https://launchpad.net/hamster-applet


Re: [PHP] time/task reporting

2012-03-01 Thread Stuart Dallas
On 1 Mar 2012, at 08:43, Robert Nilsson wrote:

 Ok, I admit -I'm lazy!
 Been asked to make a reporting tool, what and how many hours spent on
 Possible with a save option, to enable continuously adding during the week, 
 before sending off by mail to manager and one self.
 
 Surely I'm not the first person looking at a similar tool, been searching a 
 bit but not found example code to use for adjustment to suite my group needs.
 
 Anyone care to share or point me to a site where I can find this?

This wheel has been invented many times already. Save yourself some time and 
money and use an existing service: 
http://www.google.com/search?q=online+time+tracking

Add up what your time will cost to develop a solution, double it because your 
estimate will almost certainly be too low, then double it again to cover 
maintenance for the first year, and compare that figure to what a SaaS solution 
will cost for one year. Unless your requirements are sufficiently different to 
that which already exists, or you want to develop this as a learning 
experience, grab a wheel off the shelf.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time zone in date function

2012-01-30 Thread Simon J Welsh
On 31/01/2012, at 2:55 PM, Ron Piggott wrote:

 
 On my clients account when I use “echo date(‘D, d M Y H:i:s');” the output is 
 5 hours ahead of us.  How do I change it to my local time?  Is there a way to 
 specify “Eastern” time zone?
 
 I expect this would work:
 
 echo date(‘D, d M Y H:i:s' , ( strtotime( date(‘D, d M Y H:i:s') – 21600  ) ) 
 );
 
 I would prefer to specify Eastern time, so if the web host changes a server 
 setting it will remain in Eastern time zone.  Ron
 
 
 Ron Piggott


You can set the timezone for your script using date_default_timezone_set() 
http://php.net/manual/en/function.date-default-timezone-set.php
---
Simon Welsh
Admin of http://simon.geek.nz/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time zones are spinning my brain

2011-06-29 Thread Richard Quadling
On 29 June 2011 17:09, Brian Dunning br...@briandunning.com wrote:
 Help. I'm using PayPal's API to get a report of all the yesterday's 
 transactions. I'm in California, and I define yesterday as California's 
 yesterday, midnight to midnight.

 PayPal wants the STARTDATE and ENDDATE provided in UTC/GMT. I'm building and 
 testing my report using this:

 $start = gmdate('Y-m-d\TH:i:s.00\Z', strtotime(yesterday 00:00:00));
 $end = gmdate('Y-m-d\TH:i:s.00\Z', strtotime(yesterday 23:59:59));

 which produces:

 2011-06-28T07:00:00.00Z
 2011-06-29T06:59:59.00Z

 I think this is right, since it's 7 hours off California time, but I just 
 need someone to double check my spinning head. Will this give me the PayPal 
 transactions that arrived during California's yesterday, or do I need to 
 change something?
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



Something like this ?

?php
$o_Start = new DateTime('00:00:00.000', $o_CalifTZ = new
DateTimeZone('America/Los_Angeles'));
$o_End   = new DateTime('23:59:59.999', $o_CalifTZ);
echo date('Y-m-d\TH:i:s.00\Z', $o_Start-getTimestamp()), ' to ',
date('Y-m-d\TH:i:s.99\Z', $o_End-getTimestamp()), PHP_EOL;


And UTC is not the same as GMT. Ish.

GMT is only valid for 6 months of the year. Then, due to DST, it becomes BST.

UTC is just UTC.

Also, your DST may not be on the same day as GMT-BST.

Using the timezone America/Los_Angeles holds all the various shifts in
DST and offset that have been recorded, so you can use current local
time (shifted with DST just like you would read off your watch of PC)
with that timezone and PHP can work out what the timestamp is.

It sounds a little messy, but the TLA timezones aren't always sufficient.

Derick did a really good talk about this a couple of years ago for
php|Architect. I'm sure there's a video somewhere of it.

All makes perfect sense in the end.

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time zones are spinning my brain

2011-06-29 Thread Geoff Shang

On Wed, 29 Jun 2011, Brian Dunning wrote:


$start = gmdate('Y-m-d\TH:i:s.00\Z', strtotime(yesterday 00:00:00));
$end = gmdate('Y-m-d\TH:i:s.00\Z', strtotime(yesterday 23:59:59));


I think this is right, since it's 7 hours off California time, but I 
just need someone to double check my spinning head. Will this give me 
the PayPal transactions that arrived during California's yesterday, or 
do I need to change something?


Assuming your timezone is set to California time ( 
date_default_timezone_set ('America/Los_Angeles') ), then yes.


Geoff.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re: [PHP] Time zones are spinning my brain

2011-06-29 Thread Tim Streater
On 29 Jun 2011 at 17:25, Richard Quadling rquadl...@gmail.com wrote: 

 And UTC is not the same as GMT. Ish.

Yes it is.

 GMT is only valid for 6 months of the year. Then, due to DST, it becomes BST.

No, the UK is on GMT for 5 months a year and then on BST (GMT+1) for 7 months.


--
Cheers  --  Tim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Time zones are spinning my brain

2011-06-29 Thread Geoff Shang

On Wed, 29 Jun 2011, Richard Quadling wrote:


And UTC is not the same as GMT. Ish.

GMT is only valid for 6 months of the year. Then, due to DST, it becomes BST.

UTC is just UTC.


This is incorrect.  For all practical purposes, GMT and UTC are the same. 
The fact that the time in Greenwich is not GMT/UTC for half the year is 
not relevant.


http://www.diffen.com/difference/GMT_vs_UTC

All the GM* functions (gmdate, gmstrftime, etc) are intended for dealing 
with Universal Co-ordinated Time.


As a side note, there is (or at least was) no gmstrtotime function.  I get 
around this by putting  + at the end of the string.


HTH,
Geoff.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time zones are spinning my brain

2011-06-29 Thread Brian Dunning
Thanks everyone. It seems to be working correctly. You gave me some extra peace 
of mind. I did set the date_default_timezone_set('America/Los_Angeles') but it 
looks like that was in the defaults anyway.  :-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time zones are spinning my brain

2011-06-29 Thread Geoff Shang

On Wed, 29 Jun 2011, Brian Dunning wrote:

Thanks everyone. It seems to be working correctly. You gave me some 
extra peace of mind. I did set the 
date_default_timezone_set('America/Los_Angeles') but it looks like that 
was in the defaults anyway.  :-)


It probably is if this is where your site is hosted.  But all you need to 
do is change hosting providers to one somewhere else, or for someone who's 
not careful to mess something up on the system, and the script will break 
all because you assumed it would always be right.  So better to set it and 
know it's right.


Geoff.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time zone ignored (both via ini or in code)

2010-11-02 Thread Dan Yost
On Tue, Nov 2, 2010 at 12:29 AM, Nathan Nobbe quickshif...@gmail.com wrote:
 a few thoughts,
 1. set error_reporting to E_ALL to see if the engine is trying to tell you
 something you may be overlooking


Sorry, failed to mention that I did this, and it says nothing.


 2. for grins, maybe see if the TZ environment variable is set on your system
     var_dump(getenv('TZ'));


I didn't post the phpinfo() output originally but had checked and no,
TZ isn't set.


 3. another test would be to set date.timezone to something else and see if
 date_default_timezone_get() returns that new value, which would indicate
 it's falling through to the third option in the precedence chain.


AHA!

I had tried checking validity by setting a BOGUS time zone (which
showed that it was taking effect), but I had not tried checking by
setting an alternate VALID time zone.

Guess what? It works. If I set it to America/Denver, I get correct output.

Thus, something is corrupt in the timezone DB itself (which I believe
is internal to PHP from what I understand from the threads I've read).

America/Chicago is completely broken but America/Denver works just fine.

Incidentally, I have noticed that CentOS is completely broken in their
tz distro. Every time it updates, it includes a US/Central file that
is completely invalid. This has persisted for months--at the OS level
I've fixed it by copying in a valid US/Central file from another box.
But doing that does not fix PHP (tried that just now)--which again I'd
expect it not to anyway, since I believe PHP (as of PHP5) has an
internal timezone DB. But I tried it just in case.

So now I suppose the thread becomes: how do I get a valid US/Central
(America/Chicago) timezone in PHP5?

Thanks much,
Dan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time zone ignored (both via ini or in code)

2010-11-02 Thread Nathan Nobbe
On Tue, Nov 2, 2010 at 7:52 AM, Dan Yost yod...@gmail.com wrote:


 So now I suppose the thread becomes: how do I get a valid US/Central
 (America/Chicago) timezone in PHP5?


give the timezonedb extension a shot

http://pecl.php.net/package/timezonedb

-nathan


Re: [PHP] time zone ignored (both via ini or in code)

2010-11-02 Thread Dan Yost
On Tue, Nov 2, 2010 at 9:19 AM, Nathan Nobbe quickshif...@gmail.com wrote:
 On Tue, Nov 2, 2010 at 7:52 AM, Dan Yost yod...@gmail.com wrote:

 So now I suppose the thread becomes: how do I get a valid US/Central
 (America/Chicago) timezone in PHP5?

 give the timezonedb extension a shot
 http://pecl.php.net/package/timezonedb


Tried it, no change. It is still impossible to get simple CENTRAL
timezone output. This is maddening.

Dan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time zone ignored (both via ini or in code)

2010-11-02 Thread Nathan Nobbe
On Tue, Nov 2, 2010 at 8:44 AM, Dan Yost yod...@gmail.com wrote:

 On Tue, Nov 2, 2010 at 9:19 AM, Nathan Nobbe quickshif...@gmail.com
 wrote:
  On Tue, Nov 2, 2010 at 7:52 AM, Dan Yost yod...@gmail.com wrote:
 
  So now I suppose the thread becomes: how do I get a valid US/Central
  (America/Chicago) timezone in PHP5?
 
  give the timezonedb extension a shot
  http://pecl.php.net/package/timezonedb


 Tried it, no change. It is still impossible to get simple CENTRAL
 timezone output. This is maddening.


That's really weird since I'm sure php has its own timezone db, and it
sounds like that's where PHP is getting it if you saw the correct output
after switching date.timezone to America/Denver.  What about trying
date_default_timezone_set() ?

-nathan


Re: [PHP] time zone ignored (both via ini or in code)

2010-11-02 Thread Dan Yost
On Tue, Nov 2, 2010 at 11:02 AM, Nathan Nobbe quickshif...@gmail.com wrote:
 
  So now I suppose the thread becomes: how do I get a valid US/Central
  (America/Chicago) timezone in PHP5?
 
  give the timezonedb extension a shot
  http://pecl.php.net/package/timezonedb


 Tried it, no change. It is still impossible to get simple CENTRAL
 timezone output. This is maddening.

 That's really weird since I'm sure php has its own timezone db, and it
 sounds like that's where PHP is getting it if you saw the correct output
 after switching date.timezone to America/Denver.  What about trying
 date_default_timezone_set() ?


I had tried that originally too. It does set the timezone correctly,
but then again so does the ini set. So the timezone does get set to
America/Chicago with a date_default_timezone_set(), and then PHP
shanks from there, showing UTC. It seems certain that the timezone
*does* get set to America/Chicago (via multiple methods), and that
America/Chicago *itself* is corrupt in PHP--and that's even with
timezonedb installed. Now everybody knows Chicago is full of
corruption, but at least the clocks aren't, right?

Surely there are bizillions of others out there running this
combination of software in the Central time zone! Yet it's as if
nobody else has corrupt timezone DB records (be they internal or via
timezonedb) except me. And I can't help but notice how CentOS (tzdata
package) is also corrupt, every single time it gets updated, on the
Central zone but no others. Obviously these should be entirely
separate issues, but somebody out there has it out for the Central
time zone. Probably a Yankees fan.

Dan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time zone ignored (both via ini or in code)

2010-11-02 Thread Nathan Nobbe
On Tue, Nov 2, 2010 at 10:11 AM, Dan Yost yod...@gmail.com wrote:

 On Tue, Nov 2, 2010 at 11:02 AM, Nathan Nobbe quickshif...@gmail.com
 wrote:
  
   So now I suppose the thread becomes: how do I get a valid US/Central
   (America/Chicago) timezone in PHP5?
  
   give the timezonedb extension a shot
   http://pecl.php.net/package/timezonedb
 
 
  Tried it, no change. It is still impossible to get simple CENTRAL
  timezone output. This is maddening.
 
  That's really weird since I'm sure php has its own timezone db, and it
  sounds like that's where PHP is getting it if you saw the correct output
  after switching date.timezone to America/Denver.  What about trying
  date_default_timezone_set() ?


 I had tried that originally too. It does set the timezone correctly,
 but then again so does the ini set. So the timezone does get set to
 America/Chicago with a date_default_timezone_set(), and then PHP
 shanks from there, showing UTC. It seems certain that the timezone
 *does* get set to America/Chicago (via multiple methods), and that
 America/Chicago *itself* is corrupt in PHP--and that's even with
 timezonedb installed. Now everybody knows Chicago is full of
 corruption, but at least the clocks aren't, right?

 Surely there are bizillions of others out there running this
 combination of software in the Central time zone! Yet it's as if
 nobody else has corrupt timezone DB records (be they internal or via
 timezonedb) except me. And I can't help but notice how CentOS (tzdata
 package) is also corrupt, every single time it gets updated, on the
 Central zone but no others. Obviously these should be entirely
 separate issues, but somebody out there has it out for the Central
 time zone. Probably a Yankees fan.


dude at this point i dont want to sound too much like a troll, but php 5.1
is some really old software.  frankly this is why i chose not to run on
centos during my evaluation of it.  i understand the concept behind running
proven stable software, but i think centos is taking that notion to the
extreme.  i would probly try building a more recent version of php from
source and see if that helps.

-nathan


Re: [PHP] time zone ignored (both via ini or in code)

2010-11-02 Thread Nathan Nobbe
On Tue, Nov 2, 2010 at 10:37 AM, Nathan Nobbe quickshif...@gmail.comwrote:

 dude at this point i dont want to sound too much like a troll, but php 5.1
 is some really old software.  frankly this is why i chose not to run on
 centos during my evaluation of it.  i understand the concept behind running
 proven stable software, but i think centos is taking that notion to the
 extreme.  i would probly try building a more recent version of php from
 source and see if that helps.


yeah, we have one centos box left on our network atm, 5.2

$ cat /etc/redhat-release
CentOS release 5.2 (Final)

php 5.2.6

$ php -v
PHP 5.2.6 (cli) (built: May  5 2008 14:41:03)
Copyright (c) 1997-2008 The PHP Group

looks like if i set the timezone explicitly the date functions are working
correctly (obviously though im not sure if this is a 5.1 vs 5.2 issue, just
saying :D)

php  echo Br . strftime(%D %T %z %Z) . br;
Br11/02/10 10:40:12 -0600 MDTbr

php  date_default_timezone_set('America/Chicago');
php  echo Br . strftime(%D %T %z %Z) . br;
Br11/02/10 11:40:53 -0500 CDTbr

-nathan


Re: [PHP] time zone ignored (both via ini or in code)

2010-11-02 Thread Dan Yost
On Tue, Nov 2, 2010 at 11:37 AM, Nathan Nobbe quickshif...@gmail.com wrote:

 dude at this point i dont want to sound too much like a troll, but php 5.1
 is some really old software.  frankly this is why i chose not to run on
 centos during my evaluation of it.  i understand the concept behind running
 proven stable software, but i think centos is taking that notion to the
 extreme.  i would probly try building a more recent version of php from
 source and see if that helps.


That's OK, I knew this was coming. It's been a real struggle to be
deploying something so old, yet CentOS insists on nothing but 5.1 in
the packages unless you resort to some volatile repositories, which
kind of defeats the purpose (in my case, that is). I used to always go
with source directly but was really hoping to go the
somewhat-brainless auto-update route, sticking to yum packages and
all that.

At risk of sending this thread too far down an OS-specific path, can
anybody in the CentOS+PHP world comment on yum packages, 5.1, and this
actual issue?

(In the very beginning I scoured the Net, thinking surely 5.1.6 can't
be the standard on CentOS, but kept running into the either go from
source yourself or use volatile repositories claims, which aren't
good in an enterprise case, though I realize using source isn't bad
from that standpoint).

Dan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time zone ignored (both via ini or in code)

2010-11-01 Thread Nathan Nobbe
On Mon, Nov 1, 2010 at 12:54 PM, Dan Yost yod...@gmail.com wrote:

 Greetings,

 I've looked through a number of different archived threads (some
 rather heated) and samples as well, but clearly I'm just missing
 something.

 PHP 5.1.6
 CentOS release 5.5 (Final)

 My server is in Central Time (US). We do observe DST. I noticed
 functions like strftime() display UTC time. So I undertook fixing
 this.

 I read several threads about setting date.timezone in php.ini, and
 arguments for/against different timezone methods. But in my case I see
 no reason why setting the timezone in php.ini would hurt us--we can
 live with that. And yet:

 [...@ez2 html 13:47:20]$ date
 Mon Nov  1 13:50:05 CDT 2010

 Good.

 [...@ez2 html 13:50:05]$ grep -i timezone /etc/php.ini
 date.timezone = America/Chicago

 Good--and yes, Apache was restarted. So far, we're Central, life is good.

 Let's hit PHP now:

 
 ?
 if (date_default_timezone_get()) {
echo 'date_default_timezone_get: ' . date_default_timezone_get() . 'br
 /';
 }

 if (ini_get('date.timezone')) {
echo 'date.timezone: ' . ini_get('date.timezone');
 }

 echo Br;

 $localtime = localtime();
 $localtime_assoc = localtime(time(), true);
 print_r($localtime);
 print_r($localtime_assoc);


 echo Br . strftime(%D %T %z %Z) . br;

 ?
 


 Which produces:


 date_default_timezone_get: America/Chicago
 date.timezone: America/Chicago
 Array ( [0] = 14 [1] = 51 [2] = 18 [3] = 1 [4] = 10 [5] = 110
 [6] = 1 [7] = 304 [8] = 0 ) Array ( [tm_sec] = 14 [tm_min] = 51
 [tm_hour] = 18 [tm_mday] = 1 [tm_mon] = 10 [tm_year] = 110
 [tm_wday] = 1 [tm_yday] = 304 [tm_isdst] = 0 )
 11/01/10 18:51:14 + UTC


 Timezone is America/Chicago, yet date functions completely ignore this
 and continue to display UTC.

 Please help me understand where I'm blind here.


a few thoughts,

1. set error_reporting to E_ALL to see if the engine is trying to tell you
something you may be overlooking

2. for grins, maybe see if the TZ environment variable is set on your system
var_dump(getenv('TZ'));

3. another test would be to set date.timezone to something else and see if
date_default_timezone_get() returns that new value, which would indicate
it's falling through to the third option in the precedence chain.

lastly you might see if the calling date_default_timezone_set() does the
trick.

-nathan


RE: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Jason
Hi,

That's because %m is month, what you need is %M for minute (note uppercase).

Check out http://php.net/strftime 

HTH
J

-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com] 
Sent: 06 October 2009 08:53
To: php-general@lists.php.net
Subject: [PHP] Time Problem: always ten past xx

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date  
and time.

So I get for example 10:30 and 06.10.2009. Standard german time  
format. Now I try to get the correct timestamp:

$time = strtotime(06.10.2009 10:30);
var_dump($time);
var_dump(strftime(%d.%m.%Y %H:%m,$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always 10, no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Mert Oztekin
You also write the answer

var_dump(strftime(%d.%m.%Y %H:%m,$time));

there are 2 %m  you see? %m is month :)

for minute use %i


-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com]
Sent: Tuesday, October 06, 2009 10:53 AM
To: php-general@lists.php.net
Subject: [PHP] Time Problem: always ten past xx

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date
and time.

So I get for example 10:30 and 06.10.2009. Standard german time
format. Now I try to get the correct timestamp:

$time = strtotime(06.10.2009 10:30);
var_dump($time);
var_dump(strftime(%d.%m.%Y %H:%m,$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always 10, no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  
Bu mesaj ve ekleri, mesajda g?nderildi?i belirtilen ki?i/ki?ilere ?zeldir ve 
gizlidir. Size yanl??l?kla ula?m??sa l?tfen g?nderen kisiyi bilgilendiriniz ve 
mesaj? sisteminizden siliniz. Mesaj ve eklerinin i?eri?i ile ilgili olarak 
?irketimizin herhangi bir hukuki sorumlulu?u bulunmamaktad?r. ?irketimiz 
mesaj?n ve bilgilerinin size de?i?ikli?e u?rayarak veya ge? ula?mas?ndan, 
b?t?nl???n?n ve gizlili?inin korunamamas?ndan, vir?s i?ermesinden ve bilgisayar 
sisteminize verebilece?i herhangi bir zarardan sorumlu tutulamaz.

This message and attachments are confidential and intended for the 
individual(s) stated in this message. If you received this message in error, 
please immediately notify the sender and delete it from your system. Our 
company has no legal responsibility for the contents of the message and its 
attachments. Our company shall have no liability for any changes or late 
receiving, loss of integrity and confidentiality, viruses and any damages 
caused in anyway to your computer system.


Re: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Matthias Laug

argh, why do I always stick to the stupid questions :( sorry

Am 06.10.2009 um 10:03 schrieb Mert Oztekin:


You also write the answer

var_dump(strftime(%d.%m.%Y %H:%m,$time));

there are 2 %m  you see? %m is month :)

for minute use %i


-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com]
Sent: Tuesday, October 06, 2009 10:53 AM
To: php-general@lists.php.net
Subject: [PHP] Time Problem: always ten past xx

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date
and time.

So I get for example 10:30 and 06.10.2009. Standard german time
format. Now I try to get the correct timestamp:

$time = strtotime(06.10.2009 10:30);
var_dump($time);
var_dump(strftime(%d.%m.%Y %H:%m,$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always 10, no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


  
Bu mesaj ve ekleri, mesajda gönderildiği belirtilen kişi/kişilere  
özeldir ve gizlidir. Size yanlışlıkla ulaşmışsa lütfen  
gönderen kisiyi bilgilendiriniz ve mesajı sisteminizden siliniz.  
Mesaj ve eklerinin içeriği ile ilgili olarak şirketimizin herhangi  
bir hukuki sorumluluğu bulunmamaktadır. Şirketimiz mesajın ve  
bilgilerinin size değişikliğe uğrayarak veya geç ulaşmasından,  
bütünlüğünün ve gizliliğinin korunamamasından, virüs  
içermesinden ve bilgisayar sisteminize verebileceği herhangi bir  
zarardan sorumlu tutulamaz.


This message and attachments are confidential and intended for the  
individual(s) stated in this message. If you received this message  
in error, please immediately notify the sender and delete it from  
your system. Our company has no legal responsibility for the  
contents of the message and its attachments. Our company shall have  
no liability for any changes or late receiving, loss of integrity  
and confidentiality, viruses and any damages caused in anyway to  
your computer system.


Matthias Laug
Schillerstraße 36
10627 Berlin

Tel.: 0176 / 20 14 21 63
eMail: matthias.l...@gmail.com





RE: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Mert Oztekin
Jason,

%M is also month:

Month --- ---
F A full textual representation of a month, such as January or March January 
through December
m Numeric representation of a month, with leading zeros 01 through 12
M A short textual representation of a month, three letters Jan through Dec
n Numeric representation of a month, without leading zeros 1 through 12
t Number of days in the given month 28 through 31

Time --- ---
i Minutes with leading zeros 00 to 59

http://tr.php.net/manual/en/function.date.php



-Original Message-
From: Jason [mailto:networkad...@emarket2.com]
Sent: Tuesday, October 06, 2009 11:04 AM
To: 'Matthias Laug'; php-general@lists.php.net
Subject: RE: [PHP] Time Problem: always ten past xx

Hi,

That's because %m is month, what you need is %M for minute (note uppercase).

Check out http://php.net/strftime

HTH
J

-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com]
Sent: 06 October 2009 08:53
To: php-general@lists.php.net
Subject: [PHP] Time Problem: always ten past xx

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date
and time.

So I get for example 10:30 and 06.10.2009. Standard german time
format. Now I try to get the correct timestamp:

$time = strtotime(06.10.2009 10:30);
var_dump($time);
var_dump(strftime(%d.%m.%Y %H:%m,$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always 10, no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  
Bu mesaj ve ekleri, mesajda g?nderildi?i belirtilen ki?i/ki?ilere ?zeldir ve 
gizlidir. Size yanl??l?kla ula?m??sa l?tfen g?nderen kisiyi bilgilendiriniz ve 
mesaj? sisteminizden siliniz. Mesaj ve eklerinin i?eri?i ile ilgili olarak 
?irketimizin herhangi bir hukuki sorumlulu?u bulunmamaktad?r. ?irketimiz 
mesaj?n ve bilgilerinin size de?i?ikli?e u?rayarak veya ge? ula?mas?ndan, 
b?t?nl???n?n ve gizlili?inin korunamamas?ndan, vir?s i?ermesinden ve bilgisayar 
sisteminize verebilece?i herhangi bir zarardan sorumlu tutulamaz.

This message and attachments are confidential and intended for the 
individual(s) stated in this message. If you received this message in error, 
please immediately notify the sender and delete it from your system. Our 
company has no legal responsibility for the contents of the message and its 
attachments. Our company shall have no liability for any changes or late 
receiving, loss of integrity and confidentiality, viruses and any damages 
caused in anyway to your computer system.


RE: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Mert Oztekin
My mistake,

I thought it was date() now strftime()
Sorry

(why do php developers create two different standarts for such similiar 
functions???☺ )

_
From: Mert Oztekin
Sent: Tuesday, October 06, 2009 11:07 AM
To: 'Jason'; 'Matthias Laug'; php-general@lists.php.net
Subject: RE: [PHP] Time Problem: always ten past xx


Jason,

%M is also month:

Month --- ---
F A full textual representation of a month, such as January or March January 
through December
m Numeric representation of a month, with leading zeros 01 through 12
M A short textual representation of a month, three letters Jan through Dec
n Numeric representation of a month, without leading zeros 1 through 12
t Number of days in the given month 28 through 31

Time --- ---
i Minutes with leading zeros 00 to 59

http://tr.php.net/manual/en/function.date.php



-Original Message-
From: Jason [mailto:networkad...@emarket2.com]
Sent: Tuesday, October 06, 2009 11:04 AM
To: 'Matthias Laug'; php-general@lists.php.net
Subject: RE: [PHP] Time Problem: always ten past xx

Hi,

That's because %m is month, what you need is %M for minute (note uppercase).

Check out http://php.net/strftime

HTH
J

-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com]
Sent: 06 October 2009 08:53
To: php-general@lists.php.net
Subject: [PHP] Time Problem: always ten past xx

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date
and time.

So I get for example 10:30 and 06.10.2009. Standard german time
format. Now I try to get the correct timestamp:

$time = strtotime(06.10.2009 10:30);
var_dump($time);
var_dump(strftime(%d.%m.%Y %H:%m,$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always 10, no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  
Bu mesaj ve ekleri, mesajda gönderildiği belirtilen kişi/kişilere özeldir ve 
gizlidir. Size yanlışlıkla ulaşmışsa lütfen gönderen kisiyi bilgilendiriniz ve 
mesajı sisteminizden siliniz. Mesaj ve eklerinin içeriği ile ilgili olarak 
şirketimizin herhangi bir hukuki sorumluluğu bulunmamaktadır. Şirketimiz 
mesajın ve bilgilerinin size değişikliğe uğrayarak veya geç ulaşmasından, 
bütünlüğünün ve gizliliğinin korunamamasından, virüs içermesinden ve bilgisayar 
sisteminize verebileceği herhangi bir zarardan sorumlu tutulamaz.

This message and attachments are confidential and intended for the 
individual(s) stated in this message. If you received this message in error, 
please immediately notify the sender and delete it from your system. Our 
company has no legal responsibility for the contents of the message and its 
attachments. Our company shall have no liability for any changes or late 
receiving, loss of integrity and confidentiality, viruses and any damages 
caused in anyway to your computer system.


RE: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Jason
Hi Mert,

But we're not talking about date() here, we're talking strftime().

According to the manual %i doesn't do anything in strftime(). Closest match
is %I which is 12-hour format for hours.

HTH
J

-Original Message-
From: Mert Oztekin [mailto:mozte...@anadolusigorta.com.tr] 
Sent: 06 October 2009 09:07
To: 'Jason'; 'Matthias Laug'; php-general@lists.php.net
Subject: RE: [PHP] Time Problem: always ten past xx

Jason,

%M is also month:

Month --- ---
F A full textual representation of a month, such as January or March January
through December
m Numeric representation of a month, with leading zeros 01 through 12
M A short textual representation of a month, three letters Jan through Dec
n Numeric representation of a month, without leading zeros 1 through 12
t Number of days in the given month 28 through 31

Time --- ---
i Minutes with leading zeros 00 to 59

http://tr.php.net/manual/en/function.date.php



-Original Message-
From: Jason [mailto:networkad...@emarket2.com]
Sent: Tuesday, October 06, 2009 11:04 AM
To: 'Matthias Laug'; php-general@lists.php.net
Subject: RE: [PHP] Time Problem: always ten past xx

Hi,

That's because %m is month, what you need is %M for minute (note uppercase).

Check out http://php.net/strftime

HTH
J

-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com]
Sent: 06 October 2009 08:53
To: php-general@lists.php.net
Subject: [PHP] Time Problem: always ten past xx

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date
and time.

So I get for example 10:30 and 06.10.2009. Standard german time
format. Now I try to get the correct timestamp:

$time = strtotime(06.10.2009 10:30);
var_dump($time);
var_dump(strftime(%d.%m.%Y %H:%m,$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always 10, no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  
Bu mesaj ve ekleri, mesajda g?nderildi?i belirtilen ki?i/ki?ilere ?zeldir ve
gizlidir. Size yanl??l?kla ula?m??sa l?tfen g?nderen kisiyi bilgilendiriniz
ve mesaj? sisteminizden siliniz. Mesaj ve eklerinin i?eri?i ile ilgili
olarak ?irketimizin herhangi bir hukuki sorumlulu?u bulunmamaktad?r.
?irketimiz mesaj?n ve bilgilerinin size de?i?ikli?e u?rayarak veya ge?
ula?mas?ndan, b?t?nl???n?n ve gizlili?inin korunamamas?ndan, vir?s
i?ermesinden ve bilgisayar sisteminize verebilece?i herhangi bir zarardan
sorumlu tutulamaz.

This message and attachments are confidential and intended for the
individual(s) stated in this message. If you received this message in error,
please immediately notify the sender and delete it from your system. Our
company has no legal responsibility for the contents of the message and its
attachments. Our company shall have no liability for any changes or late
receiving, loss of integrity and confidentiality, viruses and any damages
caused in anyway to your computer system.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Tom Worster
On 10/6/09 4:16 AM, Mert Oztekin mozte...@anadolusigorta.com.tr wrote:

 My mistake,
 
 I thought it was date() now strftime()
 Sorry
 
 (why do php developers create two different standarts for such similiar
 functions???☺ )
 

it's traditional to do so. it reminds me of the bit about subtly
incompatible shells in unix from Real Programmers Don't Use Pascal:

Even Unix might not be as bad on Real Programmers as it once was. The
latest release of Unix has the potential of an operating system worthy of
any Real Programmer-- two different and subtly incompatible user interfaces,
an arcane and complicated teletype driver, virtual memory. If you ignore the
fact that it's structured, even 'C' programming can be appreciated by the
Real Programmer: after all, there's no type checking, variable names are
seven (ten? eight?) characters long, and the added bonus of the Pointer data
type is thrown in-- like having the best parts of Fortran and assembly
language in one place. (Not to mention some of the more creative uses for
#define.)

we could collect a list:

gnu make vs bsd make
how many subtly different versions of grep are there?


but i'm, sure it's been done already and i guess it's off topic.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time Problem: always ten past xx

2009-10-06 Thread tedd

At 10:07 AM +0200 10/6/09, Matthias Laug wrote:

argh, why do I always stick to the stupid questions :( sorry


Because with the important questions, you don't need answers. You 
understand them.


Cheers,

tedd


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time keeping in DB

2009-08-05 Thread Ashley Sheridan
On Wed, 2009-08-05 at 14:18 -0500, Shawn McKenzie wrote:
 So, obviously not PHP related, but I'm looking for thoughts on the best
 way to record time sheets in a DB.  A time sheet for hours worked per
 day, not like a time clock where you start and stop.
 
 The two possibilities that I have thought of are (these are simplistic,
 of course I'll be storing references to the user, the project code etc.):
 
 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5,
 d6, d7) where the dX field holds the hours worked
 2. One record for each day (date, hours)
 
 -- 
 Thanks!
 -Shawn
 http://www.spidean.com
 
I'd go with a record per timesheet, so you might end up with more than
one timesheet per day. That way, it's just simple SQL to find out how
many hours you've worked on one day, or on one job, etc.

Thanks,
Ash
http://www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time keeping in DB

2009-08-05 Thread Jerry Wilborn
You don't mention what DB you're using, but mySQL can be quite a pain when
dealing with multiple time zones. Not impossible, but a hassle none the
less. Be sure to set aside a place to store this (and another spot for user
preferences to keep track of their TZ).
Jerry Wilborn
jerrywilb...@gmail.com


On Wed, Aug 5, 2009 at 2:20 PM, Ashley Sheridan 
a...@ashleysheridan.co.ukwrote:

 On Wed, 2009-08-05 at 14:18 -0500, Shawn McKenzie wrote:
  So, obviously not PHP related, but I'm looking for thoughts on the best
  way to record time sheets in a DB.  A time sheet for hours worked per
  day, not like a time clock where you start and stop.
 
  The two possibilities that I have thought of are (these are simplistic,
  of course I'll be storing references to the user, the project code etc.):
 
  1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5,
  d6, d7) where the dX field holds the hours worked
  2. One record for each day (date, hours)
 
  --
  Thanks!
  -Shawn
  http://www.spidean.com
 
 I'd go with a record per timesheet, so you might end up with more than
 one timesheet per day. That way, it's just simple SQL to find out how
 many hours you've worked on one day, or on one job, etc.

 Thanks,
 Ash
 http://www.ashleysheridan.co.uk


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Time keeping in DB

2009-08-05 Thread Wolf

 Shawn McKenzie nos...@mckenzies.net wrote: 
 So, obviously not PHP related, but I'm looking for thoughts on the best
 way to record time sheets in a DB.  A time sheet for hours worked per
 day, not like a time clock where you start and stop.
 
 The two possibilities that I have thought of are (these are simplistic,
 of course I'll be storing references to the user, the project code etc.):
 
 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5,
 d6, d7) where the dX field holds the hours worked
 2. One record for each day (date, hours)
 
 -- 
 Thanks!
 -Shawn
 http://www.spidean.com

Depends on what you are looking to do..

Are you also needing to keep whether or not a specific project?  
If it is regular time/Overtime? 

It may be easier to set the database up: user,week,day,project,hours,type

Then you can query the info/user off that, it should allow you to expand as 
needed.

HTH,
Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time limit on recursive procedure?

2009-06-07 Thread Per Jessen
Clancy wrote:

 I have a recursive procedure, and I set the time limit each time I
 enter it:
 
 function rec_scan($directory, ..)
 {
 set_time_limit (1);
 
 if (is_dir($new_file))
 {
 rec_scan ($new_file, )
 }
 
 }
 
 
 The way I read the manual, the timer should be reset each time I call
 rec_scanl, 

You keep calling it so as long as the execution time between each call
is  1 second, your script will keep going.

/Per


-- 
Per Jessen, Zürich (15.4°C)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time limit on recursive procedure?

2009-06-07 Thread Clancy
On Sun, 07 Jun 2009 13:04:20 +0200, p...@computer.org (Per Jessen) wrote:

Clancy wrote:

 I have a recursive procedure, and I set the time limit each time I
 enter it:
 
 function rec_scan($directory, ..)
 {
 set_time_limit (1);
 
 if (is_dir($new_file))
 {
 rec_scan ($new_file, )
 }
 
 }
 
 
 The way I read the manual, the timer should be reset each time I call
 rec_scanl, 

You keep calling it so as long as the execution time between each call
is  1 second, your script will keep going.

/Per

Thanks.  That's what I thought. I'm using it to back up my working directory to 
another
drive, and a 3 second limit wasn't long enough, so one of the directories must 
take longer
than I expected to copy.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time difference desired load

2009-04-20 Thread Bastien Koert
On Mon, Apr 20, 2009 at 1:38 PM, ad...@buskirkgraphics.com wrote:

 Suggestion on faster solutions for extremely large database.

 $ledip['started'] = '2009-04-01 13:40:34'; Example time in DB
 $ledip['touchedlast'] = '2009-04-01 13:41:28'; Example time in DB


 date('i:s', strtotime($ledip['touchedlast']) -
 strtotime($ledip['started'])); // Not a desired solution because of its
 inability to go past the minute correctly I AM AWARE.


 or

 concat( truncate( hour( timediff($ledip['touchedlast'],$ledip['started']) )
 /24, 0 ) ,  days , hour( timediff($ledip['touchedlast'],$ledip['started'])
 ) %24,  hours , minute( timediff($ledip['touchedlast'],$ledip['started'] )
 ) ,  minutes , second( timediff($ledip['touchedlast'],$ledip['started'] )
 ) ,  seconds ) as timeleft


 The results of concat truncate, allows me the flexibility or exacting time
 differences out past the minute. I am worried that the vastness of the
 database may cause me a server load or query timeframes that are undesirable
 as it grows even bigger.
 Suggestions?

 *   PLEASE 
 Do not reply to this email with your 9 million page thought of how to,  or
 some custom function that you think is all that, I do not care.
 I am asking for load desired results NOT your take on my code…

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


You are doing a lot of calculation on this combining both PHP and SQL code.
How many rows are you affecting with this query at one time?

I hate to say it, but this to me is just begging for a unix timestamps, then
you can simply deal with the seconds remaining on this counter.

-- 

Bastien

Cat, the other other white meat


Re: [PHP] time() TIMER in seconds or just numbers

2009-03-30 Thread Stuart
2009/3/30 Andrew Williams andrew4willi...@gmail.com:
 what does time();

 $t1 = time();

 {

 do something
 }
 $t2 = time();

 $end_time = $t2 - $t1;
 echo $end_time;

 what does $end_time represent?

The number of seconds it took to do something.

 how do you determine the next 5 mins?

Assuming you mean what will time() return in 5 minutes time?...

$five_minutes_time = time() + 300; // 300 seconds in 5 minutes

If you mean something else please try rephrasing the question.

-Stuart

-- 
http://stut.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time() TIMER in seconds or just numbers

2009-03-30 Thread Richard Heyes
2009/3/30 Andrew Williams andrew4willi...@gmail.com:
 what does time();

 $t1 = time();

 {

 do something
 }
 $t2 = time();

 $end_time = $t2 - $t1;
 echo $end_time;

 what does $end_time represent?

$end_time is not a great name for it: it's the time (number of
seconds) it took to go from $t1 to $t2. $duration might be better.

 how do you determine the next 5 mins?

Eh? time() + 300 is five minutes from now.

-- 
Richard Heyes

HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.net (Updated March 14th)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time() TIMER in seconds or just numbers

2009-03-30 Thread Igor Escobar
When someone does that, it means the execution time between $t1 and $t2...

Att,
Igor Escobar
systems analyst  interface designer
www . igorescobar . com



On Mon, Mar 30, 2009 at 7:38 AM, Richard Heyes rich...@php.net wrote:

 2009/3/30 Andrew Williams andrew4willi...@gmail.com:
  what does time();
 
  $t1 = time();
 
  {
 
  do something
  }
  $t2 = time();
 
  $end_time = $t2 - $t1;
  echo $end_time;
 
  what does $end_time represent?

 $end_time is not a great name for it: it's the time (number of
 seconds) it took to go from $t1 to $t2. $duration might be better.

  how do you determine the next 5 mins?

 Eh? time() + 300 is five minutes from now.

 --
 Richard Heyes

 HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
 http://www.rgraph.net (Updated March 14th)

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] time() TIMER in seconds or just numbers

2009-03-30 Thread Richard Heyes
 When someone does that, it means the execution time between $t1 and $t2...

Is that for my benefit? Believe it or not, I do know the arcane art of
subtraction...

-- 
Richard Heyes

HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.net (Updated March 14th)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time() TIMER in seconds or just numbers

2009-03-30 Thread haliphax
On Mon, Mar 30, 2009 at 10:47 AM, Richard Heyes rich...@php.net wrote:
 When someone does that, it means the execution time between $t1 and $t2...

 Is that for my benefit? Believe it or not, I do know the arcane art of
 subtraction...

I would subtract more often, but sacrificial farm animals and black
candles are so hard to come by these days...


-- 
// Todd

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time() TIMER in seconds or just numbers

2009-03-30 Thread Bastien Koert
On Mon, Mar 30, 2009 at 12:05 PM, haliphax halip...@gmail.com wrote:

 On Mon, Mar 30, 2009 at 10:47 AM, Richard Heyes rich...@php.net wrote:
  When someone does that, it means the execution time between $t1 and
 $t2...
 
  Is that for my benefit? Believe it or not, I do know the arcane art of
  subtraction...

 I would subtract more often, but sacrificial farm animals and black
 candles are so hard to come by these days...


 --
 // Todd

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

 I have a couple of managers you can have...they bleat like sheep most of
the time any way and don't provide much other than dung...


-- 

Bastien

Cat, the other other white meat


Re: [PHP] time() TIMER in seconds or just numbers

2009-03-30 Thread haliphax
On Mon, Mar 30, 2009 at 11:37 AM, Igor Escobar titiolin...@gmail.com wrote:
 The people use that to measure performance.

 If you're intersted about that read
 http://www.igorescobar.com/blog/2009/03/05/benchmarking-de-desempenho-no-php/
 (in portuguese, sorry)

 Regards,
 Igor Escobar

 On Mon, Mar 30, 2009 at 1:05 PM, haliphax halip...@gmail.com wrote:

 On Mon, Mar 30, 2009 at 10:47 AM, Richard Heyes rich...@php.net wrote:
  When someone does that, it means the execution time between $t1 and
  $t2...
 
  Is that for my benefit? Believe it or not, I do know the arcane art of
  subtraction...

 I would subtract more often, but sacrificial farm animals and black
 candles are so hard to come by these days...

Oh, I'm fully aware of what it's for. FYI, microtime() is probably
more appropriate, since 1 full second in computer terms is a loong
time.

...and I don't speak a lick of Portuguese.


-- 
// Todd

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time() TIMER in seconds or just numbers

2009-03-30 Thread Igor Escobar
Okey, but you understand the purpouse of it?


Igor Escobar
systems analyst  interface designer
www . igorescobar . com



On Mon, Mar 30, 2009 at 3:42 PM, haliphax halip...@gmail.com wrote:

 On Mon, Mar 30, 2009 at 11:37 AM, Igor Escobar titiolin...@gmail.com
 wrote:
  The people use that to measure performance.
 
  If you're intersted about that read
 
 http://www.igorescobar.com/blog/2009/03/05/benchmarking-de-desempenho-no-php/
  (in portuguese, sorry)
 
  Regards,
  Igor Escobar
 
  On Mon, Mar 30, 2009 at 1:05 PM, haliphax halip...@gmail.com wrote:
 
  On Mon, Mar 30, 2009 at 10:47 AM, Richard Heyes rich...@php.net
 wrote:
   When someone does that, it means the execution time between $t1 and
   $t2...
  
   Is that for my benefit? Believe it or not, I do know the arcane art of
   subtraction...
 
  I would subtract more often, but sacrificial farm animals and black
  candles are so hard to come by these days...

 Oh, I'm fully aware of what it's for. FYI, microtime() is probably
 more appropriate, since 1 full second in computer terms is a loong
 time.

 ...and I don't speak a lick of Portuguese.


 --
 // Todd



Re: [PHP] time() TIMER in seconds or just numbers

2009-03-30 Thread haliphax
On Mon, Mar 30, 2009 at 1:51 PM, Igor Escobar titiolin...@gmail.com wrote:
 Okey, but you understand the purpouse of it?

 On Mon, Mar 30, 2009 at 3:42 PM, haliphax halip...@gmail.com wrote:

 On Mon, Mar 30, 2009 at 11:37 AM, Igor Escobar titiolin...@gmail.com
 wrote:
  The people use that to measure performance.
 
  If you're intersted about that read
 
  http://www.igorescobar.com/blog/2009/03/05/benchmarking-de-desempenho-no-php/
  (in portuguese, sorry)
 
  Regards,
  Igor Escobar
 
  On Mon, Mar 30, 2009 at 1:05 PM, haliphax halip...@gmail.com wrote:
 
  On Mon, Mar 30, 2009 at 10:47 AM, Richard Heyes rich...@php.net
  wrote:
   When someone does that, it means the execution time between $t1 and
   $t2...
  
   Is that for my benefit? Believe it or not, I do know the arcane art
   of
   subtraction...
 
  I would subtract more often, but sacrificial farm animals and black
  candles are so hard to come by these days...

 Oh, I'm fully aware of what it's for. FYI, microtime() is probably
 more appropriate, since 1 full second in computer terms is a loong
 time.

 ...and I don't speak a lick of Portuguese.

Please stop top-posting.

I'm fully aware of what it's for == I am aware of its purpose.

My point was that time() gives you seconds since the UNIX epoch,
whereas microtime(true) will give you more accurate results if you are
looking to benchmark a script. If your script takes a few minutes and
you don't really care about measuring those milli/micro seconds, then
time() should suit your needs just fine. However, if your script can
perform an iteration in less than one second, you have already
eliminated the usefulness of time() for benchmarks.


-- 
// Todd

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time() TIMER in seconds or just numbers

2009-03-30 Thread Shawn McKenzie
Andrew Williams wrote:
 what does time();
 
 $t1 = time();
 
 {
 
 do something
 }
 $t2 = time();
 
 $end_time = $t2 - $t1;
 echo $end_time;
 
 what does $end_time represent?
 
 how do you determine the next 5 mins?

So if you haven't deduced the answer from other replies, this would
probably be more readable:

$start_time = time();  //or microtime()
//do something
$end_time = time();  //or microtime()

$duration = $end_time - $start_time;
echo $duration;

-- 
Thanks!
-Shawn
http://www.spidean.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time() TIMER in seconds or just numbers

2009-03-30 Thread haliphax
On Mon, Mar 30, 2009 at 3:35 PM, Shawn McKenzie nos...@mckenzies.net wrote:
 Andrew Williams wrote:
 what does time();

 $t1 = time();

 {

 do something
 }
 $t2 = time();

 $end_time = $t2 - $t1;
 echo $end_time;

 what does $end_time represent?

 how do you determine the next 5 mins?

 So if you haven't deduced the answer from other replies, this would
 probably be more readable:

 $start_time = time();  //or microtime()
 //do something
 $end_time = time();  //or microtime()

 $duration = $end_time - $start_time;
 echo $duration;

Don't forget--microtime() without the boolean true as an argument
will split the result into two parts. Using true as the argument
(minus quotes, of course) gives you a floating-point representation of
seconds/milliseconds/etc.


-- 
// Todd

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time Wrong

2009-01-21 Thread Edmund Hertle
2009/1/21 Gary gwp...@ptd.net

 Im pretty new with php, so this might be a pretty novice mistake, but the
 time displays wrong on two computers.

  ?php echo date('l F jS, o h i A');?

 Shows up 2 hours late...time on both computers is correct.

 Thanks


Do you mean on two computers visiting a php script? PHP is running on the
server, so it will use server time
-eddy


Re: [PHP] Time Wrong

2009-01-21 Thread Nathan Rixham

Edmund Hertle wrote:

2009/1/21 Gary gwp...@ptd.net


Im pretty new with php, so this might be a pretty novice mistake, but the
time displays wrong on two computers.

 ?php echo date('l F jS, o h i A');?

Shows up 2 hours late...time on both computers is correct.

Thanks



Do you mean on two computers visiting a php script? PHP is running on the
server, so it will use server time
-eddy



makes sense.. check out http://php.net/date_default_timezone_set - 
probaly needs set


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time Wrong

2009-01-21 Thread Gary
Thanks for all the replies, I was able to set the time zone with one of the 
tutorials.

Thanks again

Gary
Nathan Rixham nrix...@gmail.com wrote in message 
news:49779f04.4060...@gmail.com...
 Edmund Hertle wrote:
 2009/1/21 Gary gwp...@ptd.net

 Im pretty new with php, so this might be a pretty novice mistake, but 
 the
 time displays wrong on two computers.

  ?php echo date('l F jS, o h i A');?

 Shows up 2 hours late...time on both computers is correct.

 Thanks


 Do you mean on two computers visiting a php script? PHP is running on the
 server, so it will use server time
 -eddy


 makes sense.. check out http://php.net/date_default_timezone_set - probaly 
 needs set 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time Loop

2008-09-30 Thread Jim Lucas
MDB wrote:
 Hello All, I am trying to figure out how to loop through 2 given times. 
 I have a start time and a end time and want to look through every X mins
 and add a radio button.  Below is my latest try, can someone please help
 me out?
 
 
  $endTime = 17:00:00;
  $currentTime=09:00:00;
 
  $num_intervals = floor(($endTime - $currentTime) / 30);
 
  echo (Num_INter: .$num_intervals./br);
 
  $buffer_time = $currentTime;
  for($i = 0; $i  $num_intervals; $i++)
  {
echo (tr);
echo (td.$currentTime./td);
 
foreach ($days as $day)
{
echo (td);
echo (input type='radio' name='dateTimeSelection'
 value=$day);
 
echo (/td);
}
 
 
$buffer_time += $interval;
echo (/tr);
  }
 
 
 
 ps  I was having problems with my news reader, this may be posted twice,
 if so. Sorry.
 
 TIA
 

Here is what I think you are looking for.

?php

# I am guessing that your $days array looks something like this.
$days = array('Sunday',
  'Monday',
  'Tuesday',
  'Wednesday',
  'Thursday',
  'Friday',
  'Saturday');

# Get todays information
$d = getdate();

$endTime = 17:00:00;
list($et_hr, $et_min, $et_sec) = explode(':', $endTime);
$unix_endTime = mktime($et_hr, $et_min, $et_sec,
   $d['mon'], $d['mday'], $d['year']);

$currentTime=09:00:00;
list($ct_hr, $ct_min, $ct_sec) = explode(':', $currentTime);
$unix_currentTime = mktime($ct_hr, $ct_min, $ct_sec,
   $d['mon'], $d['mday'], $d['year']);

$interval = 60;

# Calculate how many rows their should be
$num_intervals = floor(($unix_endTime - $unix_currentTime) / $interval);

echo 'Num_INter: ', $num_intervals, '/br';

echo 'formtable';

for ( $i=$unix_currentTime; $i = $unix_endTime; $i=($i+$interval) ) {
  echo 'tr', 'td', date('Y/m/d H:i:s', $i), '/td';

  foreach ($days AS $day) {
echo 'td',
 'input type=radio name=dateTimeSelection value=',
 $day,
 ' /',
 $day,
 '/td';
  }
  # Don't forget to reset the $days array
  # otherwise the array pointer is at the last index
  reset($days);
  echo '/tr';
}

echo '/table/form';

?

-- 
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time Loop

2008-09-30 Thread MDB

Thank you, I will try that out.

Robert Cummings [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

On Mon, 2008-09-29 at 17:01 -0400, MDB wrote:
Hello All, I am trying to figure out how to loop through 2 given times. 
I
have a start time and a end time and want to look through every X mins 
and
add a radio button.  Below is my latest try, can someone please help me 
out?



  $endTime = 17:00:00;
  $currentTime=09:00:00;

  $num_intervals = floor(($endTime - $currentTime) / 30);


You should convert your times to minutes so you can use minute
intervals... the following was written directly into the email and so it
is UNTESTED:

?php

   $bits = explode( ':', $currentTime );
   $currentTime = $bits[0] * 60 + $bits[1];

   $bits = explode( ':', $endTime );
   $endTime = $bits[0] * 60 + $bits[1];

   $interval = 15; // minutes
   for( $i = $currentTime; $i = $endTime; $i += $interval )
   {
   $time = floor( $i / 60 ).':'.($i % 60).':00';
   }

?

Adapt to fit your needs.

Note: I used a time interval like you state in your above description (X
mins). But the code you submitted used appeared to use number of time
slices instead.

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time Loop

2008-09-29 Thread Robert Cummings
On Mon, 2008-09-29 at 17:01 -0400, MDB wrote:
 Hello All, I am trying to figure out how to loop through 2 given times.  I 
 have a start time and a end time and want to look through every X mins and 
 add a radio button.  Below is my latest try, can someone please help me out?
 
 
   $endTime = 17:00:00;
   $currentTime=09:00:00;
 
   $num_intervals = floor(($endTime - $currentTime) / 30);

You should convert your times to minutes so you can use minute
intervals... the following was written directly into the email and so it
is UNTESTED:

?php

$bits = explode( ':', $currentTime );
$currentTime = $bits[0] * 60 + $bits[1];

$bits = explode( ':', $endTime );
$endTime = $bits[0] * 60 + $bits[1];

$interval = 15; // minutes
for( $i = $currentTime; $i = $endTime; $i += $interval )
{
$time = floor( $i / 60 ).':'.($i % 60).':00';
}

?

Adapt to fit your needs.

Note: I used a time interval like you state in your above description (X
mins). But the code you submitted used appeared to use number of time
slices instead.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time formatting issues

2007-07-17 Thread Richard Lynch
The date_format function of MySQL should work for time as well...

What are the errors?

What did you use for the time format?

On Sat, July 14, 2007 8:27 am, Melissa wrote:
 I have a DB

 with a field type DATE (called TideDATE)

 and a field type TIME (one of which is called highFIRST)



 How can I format the time fields from displaying 00:00:00 (a 24 hour
 clock)
 to HH:MM am/pm format?



 The DATE function has all kinds of neat formatters, but I do not find
 any
 for TIME

 In DATE, I would say g:i A



 If I try it with a TIME field, I get errors!



 I HAVE NEVER USED A NEWSGROUP BEFORE, SO I HOPE I HAVE DONE THIS
 CORRECTLY...

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time formatting issues

2007-07-16 Thread Chris

Melissa wrote:

I have a DB

with a field type DATE (called TideDATE)

and a field type TIME (one of which is called highFIRST)



How can I format the time fields from displaying 00:00:00 (a 24 hour clock) 
to HH:MM am/pm format?


$time = '13:05:00';
list($hr, $min, $sec) = explode(':', $time);

if ($hr  12) {
  $new_time = ($hr - 12);
  $ampm = 'pm';
} elseif ($hr == 12) {
  $new_time = '12';
  $ampm = 'pm';
} else {
  $new_time = $hr;
  $ampm = 'am';
}

$new_time .= ':' . $min . ':' . $sec . ' ' . $ampm;

pretty simple ;)

(I'm sure someone will find a way to make this better but that should 
work :P).


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time formatting issues

2007-07-16 Thread [EMAIL PROTECTED]

Melissa wrote:

I have a DB

with a field type DATE (called TideDATE)

and a field type TIME (one of which is called highFIRST)



How can I format the time fields from displaying 00:00:00 (a 24 hour clock) 
to HH:MM am/pm format?




The DATE function has all kinds of neat formatters, but I do not find any 
for TIME


In DATE, I would say g:i A



If I try it with a TIME field, I get errors!



I HAVE NEVER USED A NEWSGROUP BEFORE, SO I HOPE I HAVE DONE THIS 
CORRECTLY...


  
What type of database are you using? You can probably do this right in 
the database. If MySQL you can do the following:


select DATE_FORMAT(time_column, '%h:%i:%s %p') from your_table;

Tests:

mysql select DATE_FORMAT('2007-07-16 14:19:00', '%h:%i:%s %p');
+---+
| DATE_FORMAT('2007-07-16 14:19:00', '%h:%i:%s %p') |
+---+
| 02:19:00 PM   |
+---+
1 row in set (0.00 sec)

mysql select DATE_FORMAT('2007-07-16 04:19:00', '%h:%i:%s %p');
+---+
| DATE_FORMAT('2007-07-16 04:19:00', '%h:%i:%s %p') |
+---+
| 04:19:00 AM   |
+---+
1 row in set (0.00 sec)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Time formatting issues

2007-07-16 Thread Melissa W. Dickens
Thank you VERY much Jay, Chris and Gary!


I tried the php code to change it and that worked Great, as Chris suggested

I am about to see how it flies with changing the SQL DB directly as Gary
suggested.
I might even just ADD a new DB field for the new format...

The mktime function looks VERY interesting, but confusing to a newbie...
That will be next on my list of things to try.


Melissa

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time formatting issues

2007-07-16 Thread [EMAIL PROTECTED]

Melissa W. Dickens wrote:

Thank you VERY much Jay, Chris and Gary!


I tried the php code to change it and that worked Great, as Chris suggested

I am about to see how it flies with changing the SQL DB directly as Gary
suggested.
I might even just ADD a new DB field for the new format...

The mktime function looks VERY interesting, but confusing to a newbie...
That will be next on my list of things to try.


Melissa


  
No need to create a new field just for another format. If you are using 
mysql 5 you can create a view.


mysql create view view_name as select DATE_FORMAT(time_column, 
'%h:%i:%s %p') as time from your_table;

Query OK, 0 rows affected (0.00 sec)

mysql select * from view_name;
+-+
| time|
+-+
| 12:45:41 PM |
+-+
1 row in set (0.00 sec)


This way you're not updating multiple columns with the same data 
formated differently.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Time formatting issues

2007-07-16 Thread Melissa W. Dickens


Melissa W. Dickens
[EMAIL PROTECTED]
770-667-8933
843-838-7388


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 16, 2007 12:50 PM
To: Melissa W. Dickens
Hmm...

Another reason to upgrade!
We are running version 4 something or other!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Time formatting issues

2007-07-14 Thread Jay Blanchard
[snip]
I have a DB

with a field type DATE (called TideDATE)

and a field type TIME (one of which is called highFIRST)



How can I format the time fields from displaying 00:00:00 (a 24 hour
clock) 
to HH:MM am/pm format?
[/snip]

Have a look at http://www.php.net/mktime

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Time formatting issues

2007-07-14 Thread Melissa W. Dickens


Thank you, Jay, that is interesting.

I am looking for the am / pm denomination, which I do not see in mktime()

I am essentially trying to have the TIME type which is a 24 hour clock
display instead as a 12 hour clock with am and pm.

I AM A TOTAL NEWBIE, (2ND DAY ever) so if I misunderstood the answer, I am
sorry!

Melissa

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time or date picker ?

2007-03-20 Thread tedd

At 8:11 PM +0100 3/19/07, Alain Roger wrote:

Hi,

I've already seen some webpages which include a time or date picker (like a
calendar) written in PHP and on which user could type the year and after,
select the month and date (using month).
I'm looking for something like that.

Where can i find one for free ?

thanks

--
Alain


Alain:

You can choose -- php, flash, or javascript.

http://xn--nvg.com/calendar

Let me know which one you want.

tedd

ps: If you can't read the above url, get opera.
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time or date picker ?

2007-03-19 Thread Tijnema !

On 3/19/07, Alain Roger [EMAIL PROTECTED] wrote:

Hi,

I've already seen some webpages which include a time or date picker (like a
calendar) written in PHP and on which user could type the year and after,
select the month and date (using month).
I'm looking for something like that.

Where can i find one for free ?

thanks

--
Alain


This is client side PHP is server side...

Go to the javascript list.

Tijnema



Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time or date picker ?

2007-03-19 Thread Richard Lynch
On Mon, March 19, 2007 2:11 pm, Alain Roger wrote:
 I've already seen some webpages which include a time or date picker
 (like a
 calendar) written in PHP and on which user could type the year and
 after,
 select the month and date (using month).
 I'm looking for something like that.

 Where can i find one for free ?

Actually, you haven't seen that.

You thought you saw that, because the URL ended in .php

But what you really saw was some JavaScript.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] time

2007-01-31 Thread Richard Lynch
On Mon, January 29, 2007 10:55 pm, Jay Blanchard wrote:
 [snip]
 I am writing a program for managing leads and contacts. I would like
 to
 add
 the ability to see what TIME it is where the contact is not there
 server
 time. So if you looked at a list of contacts from all over the country
 you
 would see different times compared to what time it is where the user
 is
 at.
 What should I be looking at to calculate out the different time zones.
 Could
 somebody just point me in the write direction at this time I have no
 idea on
 how to proceeded.
 [/snip]

 You would use JavaScript to capture their local 'browser' time and
 process it with PHP

Since their computer clock is probably wrong (way wrong) this may be
very problematic...

Assuming contacts know what time zone they (usually) live in, you can
ask them to set that in their profile.

You can even pre-populate it with your best guess from their IP and
one of the zillion IP to country databases floating around.

Ultimately, however, you're going to have problems because there's no
way you can know for sure for sure where the user is, even if they are
usually in time zone X.

It's amazing just how complicated time can be, when you start actually
trying to do anything useful with it.
Puns intended.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time

2007-01-30 Thread Jim Lucas

Richard Kurth wrote:

[snip]
I am writing a program for managing leads and contacts. I would like to add
the ability to see what TIME it is where the contact is not there server
time. So if you looked at a list of contacts from all over the country you
would see different times compared to what time it is where the user is at.
What should I be looking at to calculate out the different time zones.
Could
somebody just point me in the write direction at this time I have no idea on
how to proceeded.
[/snip]

You would use JavaScript to capture their local 'browser' time and process
it with PHP

I am not looking for something where I am on line with these people some do
not have internet access. I would be calling them on the phone.
I need a way to get the time at there location using what info I already
have like the address zip code and phone number. It would probably have to
be compared to a database of some sort or the time zone file on a lynx
server.


You are going to need the info found at www.melissadata.com

Something like a LERG database/cross reference

Jim

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] time

2007-01-30 Thread Bob Dusek
If you have the timezone offset stored for each contact, you can compare
that to the timezone offset of the server and do the math on a timestamp
value.  
 
// return value format:  hhmm
// -0500 for US/EST, -5 hours relative to GMT
$timeZoneOfServer = date(O);

 -Original Message-
 From: Richard Kurth [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, January 30, 2007 12:12 AM
 To: php-general@lists.php.net
 Subject: RE: [PHP] time
 
 [snip]
 I am writing a program for managing leads and contacts. I 
 would like to add
 the ability to see what TIME it is where the contact is not 
 there server
 time. So if you looked at a list of contacts from all over 
 the country you
 would see different times compared to what time it is where 
 the user is at.
 What should I be looking at to calculate out the different time zones.
 Could
 somebody just point me in the write direction at this time I 
 have no idea on
 how to proceeded.
 [/snip]
 
 You would use JavaScript to capture their local 'browser' 
 time and process
 it with PHP
 
 I am not looking for something where I am on line with these 
 people some do
 not have internet access. I would be calling them on the phone.
 I need a way to get the time at there location using what 
 info I already
 have like the address zip code and phone number. It would 
 probably have to
 be compared to a database of some sort or the time zone file on a lynx
 server.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] time

2007-01-30 Thread Jay Blanchard
[snip]

I am writing a program for managing leads and contacts. I would like to
add
the ability to see what TIME it is where the contact is not there server
time. So if you looked at a list of contacts from all over the country
you
would see different times compared to what time it is where the user is
at.
What should I be looking at to calculate out the different time zones.
Could
somebody just point me in the write direction at this time I have no
idea on
how to proceeded.


You would use JavaScript to capture their local 'browser' time and
process
it with PHP

I am not looking for something where I am on line with these people some
do
not have internet access. I would be calling them on the phone.
I need a way to get the time at there location using what info I already
have like the address zip code and phone number. It would probably have
to
be compared to a database of some sort or the time zone file on a lynx
server.
[/snip]

Aha, that was not what your original post asked. Search for time-zone
databases on Google. 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] time

2007-01-30 Thread Edward Kay

 [snip]

 I am writing a program for managing leads and contacts. I would like to
 add
 the ability to see what TIME it is where the contact is not there server
 time.

 [/snip]


I have implemented this feature in our home-grown CRM system. I used the
list of timezones on Wikipedia as a starting point and store the UTC offset
for each contact (selected from a drop down). When displaying their info, I
use this offset to calculate their local time from my server time.

BTW, you'll need to use a float since there are some non-integer timezone
differences.

Edward

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time

2007-01-30 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-30 16:52:02 -:
 BTW, you'll need to use a float since there are some non-integer timezone
 differences.

No need to lose information.  Just store the offset in minutes, problem solved.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] time

2007-01-29 Thread Jay Blanchard
[snip]
I am writing a program for managing leads and contacts. I would like to
add
the ability to see what TIME it is where the contact is not there server
time. So if you looked at a list of contacts from all over the country
you
would see different times compared to what time it is where the user is
at.
What should I be looking at to calculate out the different time zones.
Could
somebody just point me in the write direction at this time I have no
idea on
how to proceeded.
[/snip]

You would use JavaScript to capture their local 'browser' time and
process it with PHP

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time

2007-01-29 Thread tom

test
Jay Blanchard :

[snip]
I am writing a program for managing leads and contacts. I would like to
add
the ability to see what TIME it is where the contact is not there server
time. So if you looked at a list of contacts from all over the country
you
would see different times compared to what time it is where the user is
at.
What should I be looking at to calculate out the different time zones.
Could
somebody just point me in the write direction at this time I have no
idea on
how to proceeded.
[/snip]

You would use JavaScript to capture their local 'browser' time and
process it with PHP


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] time

2007-01-29 Thread Richard Kurth
[snip]
I am writing a program for managing leads and contacts. I would like to add
the ability to see what TIME it is where the contact is not there server
time. So if you looked at a list of contacts from all over the country you
would see different times compared to what time it is where the user is at.
What should I be looking at to calculate out the different time zones.
Could
somebody just point me in the write direction at this time I have no idea on
how to proceeded.
[/snip]

You would use JavaScript to capture their local 'browser' time and process
it with PHP

I am not looking for something where I am on line with these people some do
not have internet access. I would be calling them on the phone.
I need a way to get the time at there location using what info I already
have like the address zip code and phone number. It would probably have to
be compared to a database of some sort or the time zone file on a lynx
server.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time-Zone juggling

2006-11-09 Thread David Giragosian

On 11/8/06, Travis Doherty [EMAIL PROTECTED] wrote:


David Giragosian wrote:

 Does Daylight Savings alter Zulu time? (I'm guessing yes). How did the
 military deal with that?

 I use a date-time field as a primary key in db tables that get an
 insert a
 minute. I had to jump through a number of hoops to turn off DST on the
 (RH
 Linux) server.

 David

UTC (or GMT, or Zulu, or Z) does not observe Daylight Savings Time.  In
any database that you store timestamps and need to know exactly what
that timestamp means you should use UTC, then use application logic to
translate to the users time zone.

Another option would be to store epoch time (seconds since the OS's
epoch) and work the same result from that, I prefer storing
human-readable timestamps even if you have to do the datemath in your
head to read them in your own timezone.  Epoch does not count
leap-seconds like UTC so it can be off by a tiny bit at any given time.
Epoch time also differs on different operating systems - Unix is
1970-01-01 at 00:00:00 UTC, Windows seems to use 1601-01-01 at 00:00:00
UTC... I don't know if that would ever matter though - I imagine the
database server would mask this and the application would port to
windows without problems (no idea.)

UTC has no DST from: http://en.wikipedia.org/wiki/Time_zone

Due to daylight saving time, UTC is local time at the Royal Observatory,
Greenwich http://en.wikipedia.org/wiki/Royal_Observatory%2C_Greenwich
only between 01:00 UTC on the last Sunday in October and 01:00 UTC on
the last Sunday in March. For the rest of the year, local time there is
UTC+1 http://en.wikipedia.org/wiki/UTC%2B1, known in the United
Kingdom http://en.wikipedia.org/wiki/United_Kingdom as British Summer
Time http://en.wikipedia.org/wiki/British_Summer_Time (BST). Similar
circumstances apply in many places.

**
Travis Doherty
TixTime



We are using now() in the MySQL db to insert current time. Database version
is 4.0.24.

I see that in 4.1.* there is utc_timestamp().
Anybody know if this function avoids DST? Might be worth the hassle of
upgrade and possible code changes in the PHP scripts to obtain this feature.
 Shudder 

Thanks,

David


Re: [PHP] Time-Zone juggling

2006-11-09 Thread M.Sokolewicz

David Giragosian wrote:

On 11/8/06, Travis Doherty [EMAIL PROTECTED] wrote:


David Giragosian wrote:

 Does Daylight Savings alter Zulu time? (I'm guessing yes). How did 
the

 military deal with that?

 I use a date-time field as a primary key in db tables that get an
 insert a
 minute. I had to jump through a number of hoops to turn off DST on the
 (RH
 Linux) server.

 David

UTC (or GMT, or Zulu, or Z) does not observe Daylight Savings Time.  In
any database that you store timestamps and need to know exactly what
that timestamp means you should use UTC, then use application logic to
translate to the users time zone.

Another option would be to store epoch time (seconds since the OS's
epoch) and work the same result from that, I prefer storing
human-readable timestamps even if you have to do the datemath in your
head to read them in your own timezone.  Epoch does not count
leap-seconds like UTC so it can be off by a tiny bit at any given time.
Epoch time also differs on different operating systems - Unix is
1970-01-01 at 00:00:00 UTC, Windows seems to use 1601-01-01 at 00:00:00
UTC... I don't know if that would ever matter though - I imagine the
database server would mask this and the application would port to
windows without problems (no idea.)

UTC has no DST from: http://en.wikipedia.org/wiki/Time_zone

Due to daylight saving time, UTC is local time at the Royal Observatory,
Greenwich http://en.wikipedia.org/wiki/Royal_Observatory%2C_Greenwich
only between 01:00 UTC on the last Sunday in October and 01:00 UTC on
the last Sunday in March. For the rest of the year, local time there is
UTC+1 http://en.wikipedia.org/wiki/UTC%2B1, known in the United
Kingdom http://en.wikipedia.org/wiki/United_Kingdom as British Summer
Time http://en.wikipedia.org/wiki/British_Summer_Time (BST). Similar
circumstances apply in many places.

**
Travis Doherty
TixTime



We are using now() in the MySQL db to insert current time. Database version
is 4.0.24.

I see that in 4.1.* there is utc_timestamp().
Anybody know if this function avoids DST? Might be worth the hassle of
upgrade and possible code changes in the PHP scripts to obtain this 
feature.

 Shudder 

Thanks,

David



you don't quite understand what UTC is, do you :)
UTC doesn't have DST. It just doesn't, at all.
If it returns a timestamp in UTC offset, it will avoid DST for you...

- tul

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time-Zone juggling

2006-11-09 Thread David Giragosian

On 11/9/06, M.Sokolewicz [EMAIL PROTECTED] wrote:


David Giragosian wrote:
 On 11/8/06, Travis Doherty [EMAIL PROTECTED] wrote:

 David Giragosian wrote:

  Does Daylight Savings alter Zulu time? (I'm guessing yes). How did
 the
  military deal with that?
 
  I use a date-time field as a primary key in db tables that get an
  insert a
  minute. I had to jump through a number of hoops to turn off DST on
the
  (RH
  Linux) server.
 
  David
 
 UTC (or GMT, or Zulu, or Z) does not observe Daylight Savings Time.  In
 any database that you store timestamps and need to know exactly what
 that timestamp means you should use UTC, then use application logic to
 translate to the users time zone.

 Another option would be to store epoch time (seconds since the OS's
 epoch) and work the same result from that, I prefer storing
 human-readable timestamps even if you have to do the datemath in your
 head to read them in your own timezone.  Epoch does not count
 leap-seconds like UTC so it can be off by a tiny bit at any given time.
 Epoch time also differs on different operating systems - Unix is
 1970-01-01 at 00:00:00 UTC, Windows seems to use 1601-01-01 at 00:00:00
 UTC... I don't know if that would ever matter though - I imagine the
 database server would mask this and the application would port to
 windows without problems (no idea.)

 UTC has no DST from: http://en.wikipedia.org/wiki/Time_zone
 
 Due to daylight saving time, UTC is local time at the Royal
Observatory,
 Greenwich http://en.wikipedia.org/wiki/Royal_Observatory%2C_Greenwich
 only between 01:00 UTC on the last Sunday in October and 01:00 UTC on
 the last Sunday in March. For the rest of the year, local time there is
 UTC+1 http://en.wikipedia.org/wiki/UTC%2B1, known in the United
 Kingdom http://en.wikipedia.org/wiki/United_Kingdom as British Summer
 Time http://en.wikipedia.org/wiki/British_Summer_Time (BST). Similar
 circumstances apply in many places.
 
 **
 Travis Doherty
 TixTime


 We are using now() in the MySQL db to insert current time. Database
version
 is 4.0.24.

 I see that in 4.1.* there is utc_timestamp().
 Anybody know if this function avoids DST? Might be worth the hassle of
 upgrade and possible code changes in the PHP scripts to obtain this
 feature.
  Shudder 

 Thanks,

 David


you don't quite understand what UTC is, do you :)
UTC doesn't have DST. It just doesn't, at all.
If it returns a timestamp in UTC offset, it will avoid DST for you...

- tul




We use now() to do timestamp inserts in the MySQL db. now() in MySQL is
based upon the OS time, which is obviously affected by timezone setting as
an offset from UTC. When I've set the RH server to use UTC, the OS time was
still affected by the rule which altered UTC to the timezone setting (I'm
in the process of moving my office or else I'd be able to find the document
describing how to alter the RH OS to not obey DST changes). My question is
based upon this experience.

If select utc_timestamp() in MySQL truly returns the UTC with timezone
offset and without any adjustments for DST, that would be just peachy.

Thanks,

David


Re: [PHP] Time-Zone juggling

2006-11-08 Thread tedd

At 12:48 AM -0500 11/8/06, Travis Doherty wrote:

This can be a big problem to some apps, and others might be fine with
the workaround like we've done where you loose a tiny bit of data (It's
08:00 on the day after the timechange, is this ticket from 01:30:00  6.5
or 7.5 hours old? who cares.. just reply.)


and

At 9:53 PM -0600 11/7/06, Richard Lynch wrote:

This time zone stuff always gets me head all spun around, I admit freely.


You're not alone.

What about just using what we did in the service, namely Zulu?

http://www.grc.nasa.gov/WWW/MAEL/ag/zulu.htm

At least that points to a common datum for all time related issues.

I just wonder how they came up with the acronym of UTC for 
Coordinated Universal Time?


Best,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time-Zone juggling

2006-11-08 Thread David Giragosian

On 11/8/06, tedd [EMAIL PROTECTED] wrote:


At 12:48 AM -0500 11/8/06, Travis Doherty wrote:
This can be a big problem to some apps, and others might be fine with
the workaround like we've done where you loose a tiny bit of data (It's
08:00 on the day after the timechange, is this ticket from 01:30:00  6.5
or 7.5 hours old? who cares.. just reply.)

and

At 9:53 PM -0600 11/7/06, Richard Lynch wrote:
This time zone stuff always gets me head all spun around, I admit freely.

You're not alone.

What about just using what we did in the service, namely Zulu?

http://www.grc.nasa.gov/WWW/MAEL/ag/zulu.htm

At least that points to a common datum for all time related issues.

I just wonder how they came up with the acronym of UTC for
Coordinated Universal Time?

Best,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



tedd,

Does Daylight Savings alter Zulu time? (I'm guessing yes). How did the
military deal with that?

I use a date-time field as a primary key in db tables that get an insert a
minute. I had to jump through a number of hoops to turn off DST on the (RH
Linux) server.

David


Re: [PHP] Time-Zone juggling

2006-11-08 Thread tedd

At 9:01 AM -0600 11/8/06, David Giragosian wrote:

tedd,

Does Daylight Savings alter Zulu time? (I'm guessing yes). How did the
military deal with that?


LOL -- do you think that the military gives a hoot about daylight 
savings time? That's one of those civilian things. In military time, 
Oh Dark Thirty, is $#%# early regardless of what civilians do.  :-)



I use a date-time field as a primary key in db tables that get an insert a
minute. I had to jump through a number of hoops to turn off DST on the (RH
Linux) server.


If it was critical to have a absolute date/time stamp, such as in a 
patient's registration on an organ transplant list, then I would hope 
that the people in charge would work with an absolute time and not 
one subject to DST or even subject to which time zone the patient is 
located. Sometimes even seconds count for selecting which patient is 
entitled to the transplant.


If they don't use an absolute time, then it would be better for a 
patient to register for a transplant on the west coast (or even 
further west) than the east coast, and that doesn't sound right, does 
it? But, I don't specifically know what method they use. Any idea?


tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time-Zone juggling

2006-11-08 Thread Travis Doherty
David Giragosian wrote:

 Does Daylight Savings alter Zulu time? (I'm guessing yes). How did the
 military deal with that?

 I use a date-time field as a primary key in db tables that get an
 insert a
 minute. I had to jump through a number of hoops to turn off DST on the
 (RH
 Linux) server.

 David

UTC (or GMT, or Zulu, or Z) does not observe Daylight Savings Time.  In
any database that you store timestamps and need to know exactly what
that timestamp means you should use UTC, then use application logic to
translate to the users time zone.

Another option would be to store epoch time (seconds since the OS's
epoch) and work the same result from that, I prefer storing
human-readable timestamps even if you have to do the datemath in your
head to read them in your own timezone.  Epoch does not count
leap-seconds like UTC so it can be off by a tiny bit at any given time. 
Epoch time also differs on different operating systems - Unix is
1970-01-01 at 00:00:00 UTC, Windows seems to use 1601-01-01 at 00:00:00
UTC... I don't know if that would ever matter though - I imagine the
database server would mask this and the application would port to
windows without problems (no idea.)

UTC has no DST from: http://en.wikipedia.org/wiki/Time_zone

Due to daylight saving time, UTC is local time at the Royal Observatory,
Greenwich http://en.wikipedia.org/wiki/Royal_Observatory%2C_Greenwich
only between 01:00 UTC on the last Sunday in October and 01:00 UTC on
the last Sunday in March. For the rest of the year, local time there is
UTC+1 http://en.wikipedia.org/wiki/UTC%2B1, known in the United
Kingdom http://en.wikipedia.org/wiki/United_Kingdom as British Summer
Time http://en.wikipedia.org/wiki/British_Summer_Time (BST). Similar
circumstances apply in many places.

**
Travis Doherty
TixTime

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time-Zone juggling

2006-11-07 Thread Travis Doherty
Richard Lynch wrote:

What is the least-stupid way to fix this, and get 20:00 in the
Portland OR server to turn into:
Mon, 03 Apr 2006 20:00:00 CDT
which is what time it really was.

E.  Without changing the schema which means having to re-do
everything else in the application.  That's probably the RIGHT way to
fix it, but that ain't happening.
  

Yeah...  I ran into the same stuff a few weeks ago with the DST change. 
The quickest solution that is *almost* OK is using
putenv(tz=america/montreal) or putenv(tz=america/san_diego) etc..
(should really be the date_default_timezone_get/set functions)

Datetime fields do not have timezone stored (mysql too.)  The only real
solution to this problem is to always store datetimes in GMT/UTC.  That
is the correct thing to do, and until that is done our workaround still
has one problem (that isn't big enough to warrant reworking the
ticketing code that inserts to the db...)

The remaining problem is that until we store in UTC we will never know
which 01:30:00 a timestamp refers to, EDT or EST (Eastern Daylight, or
Eastern Standard.)  In UTC this doesn't happen.  Of course there is no
problem for spring, only in the fall time change.

This can be a big problem to some apps, and others might be fine with
the workaround like we've done where you loose a tiny bit of data (It's
08:00 on the day after the timechange, is this ticket from 01:30:00  6.5
or 7.5 hours old? who cares.. just reply.)

Travis Doherty

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time estimating for PM's/Clients

2006-02-01 Thread Paul Novitski

At 11:10 AM 2/1/2006, Mark Steudel wrote:

I am interested in finding out what standards/formulas other PHP
programmers/departments out there are using to accurately provide time
estimates on modules to their PM's/Clients.

Any suggested reading books or sites?



Highly recommended:

Web Redesign 2.0 | Workflow that Works
http://www.web-redesign.com/

Paul 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] time and timestamp

2005-08-30 Thread Jay Blanchard
[snip]
Now I am not worried about the time but I would like to know how to

(i) sort the returned rows in order (latest first)

(ii) be able to extract the individual parts of the date and display
them in 
UK format

30.08.2005 this is the text from 30th of August

27.08.2005 this is the text from 27th of August

27.08.2005 this is the text from 23rd of August
[/snip]

http://www.php.net/date

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time and timestamp

2005-08-30 Thread Burhan Khalid

Jay Blanchard wrote:

[snip]
Now I am not worried about the time but I would like to know how to

(i) sort the returned rows in order (latest first)


add ORDER BY `yourdatefield` DESC to your SQL


(ii) be able to extract the individual parts of the date and display
them in 
UK format


Have no idea what is 'UK format'. But you can use the DATE_FORMAT MySQL 
function to do the same


DATE_FORMAT(`yourdatefield`, '%m.%d.%Y') as `date_formatted` [...]

Also, http://php.net/date

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time()

2005-07-29 Thread Marcus Bointon
On 29 Jul 2005, at 08:37, [EMAIL PROTECTED]  
[EMAIL PROTECTED] wrote:


I have the date when users registered stored in the database using  
time() function format.


Hm. I hope this means you're storing it as a TimeStamp format, or  
better, DateTime, and not as a simple integer field.


I have to search for users that are registered this week, this  
month and this year. How can i do that? I mean how can i found the  
beginning of this week?  Or the beginning of this month?


If you are storing it as a DateTime field, MySQL has loads of date  
related functions for doing this, and it's more efficient to do it  
using MySQL's functions that the equivalent in PHP. Take a look here:  
http://dev.mysql.com/doc/mysql/en/date-and-time-types.html and http:// 
dev.mysql.com/doc/mysql/en/date-and-time-functions.html


You can do the calculations in PHP. For example, to find the first  
day of this month as a timestamp:


$first = strtotime(date('Y-m-01'));

strtotime has some wonderful functionality - you can ask for dates  
like 'next week' 'last year' 'yesterday -1 week'.


To format a timestamp into a MySQL-compatible DateTime string, use:

$datetime = date('Y-m-d h:i:s', $timestamp);

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time Zone names

2005-07-13 Thread Dotan Cohen
On 7/13/05, Richard Lynch [EMAIL PROTECTED] wrote:
 I'd like to generate a list of time zones (EST, CDT, whatever) for a popup.
 
 Seems like it should be easy...
 
 This is so the Sales guy can just plug in the time and zone of who he's
 gotta call back, and I stuff that in the database, and he gets a morning
 report of who to call.
 
 ?php
   for ($offset = 0; $offset = 23; $offset++){
 $z = ???;
 echo option$z/option\n;
   }
 ?
 
 What can I use for ??? to get the time zone name for offsets?
 
 The date() function tells me what time zone the webserver is in, which is
 not even *HIS* time zone, much less the client's.
 
 The idate() function is not available.
 
 I can't just shove $offset into putenv(TZ=$offset) -- Apparently, in
 order to set TZ I would need to know, a priori, the name of the time zone,
 so that's not real helpful for what I need.
 
 I looked at all the User Contributed notes, and none seemed to answer it.
 
 I suppose I could Google for PHP time zone but...
 
 What am I missing?
 
 --
 Like Music?
 http://l-i-e.com/artists.htm
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

Richard,
Take a look at wikipedia's timezone page. You could probably parse the
table and get what you want. And it's GPL.
http://en.wikipedia.org/wiki/Time_zone

Dotan
http://lyricslist.com/lyrics/artist_albums/299/krauss_alison.php
Krauss, Alison Song Lyrics

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time Zone names

2005-07-13 Thread Philip Hallstrom

I'd like to generate a list of time zones (EST, CDT, whatever) for a popup.

Seems like it should be easy...

This is so the Sales guy can just plug in the time and zone of who he's
gotta call back, and I stuff that in the database, and he gets a morning
report of who to call.

?php
 for ($offset = 0; $offset = 23; $offset++){
   $z = ???;
   echo option$z/option\n;
 }
?

What can I use for ??? to get the time zone name for offsets?


We did this for our app... we're always on FreeBSD though, but I imagine 
the same files exist on Linux/others just somewhere else...


define(ZONETAB, /usr/share/zoneinfo/zone.tab);
$fd = @fopen(ZONETAB, r);
if (!$fd) {
print(option value='GMT'GMT);
} else {
while (!feof($fd)) {
$line = fgets($fd);
if (ereg(^US\t, $line)) {
list($x, $x, $tz_file, $tz_name) = explode(\t, 
trim($line));

print(option value='$tz_file'$tz_name);
}
}
fclose($fd);
}

Gives you a kind of odd format though (we needed the actual timezone file name,
not the offset), but maybe this gets you closer...

option value='America/New_York' Eastern Time
option value='America/Detroit' Eastern Time - Michigan - most locations
option value='America/Louisville' Eastern Time - Kentucky - Louisville area
option value='America/Kentucky/Monticello' Eastern Time - Kentucky - Wayne 
County
option value='America/Indianapolis' Eastern Standard Time - Indiana - most 
locations
option value='America/Indiana/Marengo' Eastern Standard Time - Indiana - 
Crawford County
option value='America/Indiana/Knox' Eastern Standard Time - Indiana - Starke 
County
option value='America/Indiana/Vevay' Eastern Standard Time - Indiana - 
Switzerland County
option value='America/Chicago' Central Time
option value='America/Menominee' Central Time - Michigan - Wisconsin border
option value='America/North_Dakota/Center' Central Time - North Dakota - 
Oliver County
option value='America/Denver' Mountain Time
option value='America/Boise' Mountain Time - south Idaho  east Oregon
option value='America/Shiprock' Mountain Time - Navajo
option value='America/Phoenix' Mountain Standard Time - Arizona
option value='America/Los_Angeles' selectedPacific Time
option value='America/Anchorage' Alaska Time
option value='America/Juneau' Alaska Time - Alaska panhandle
option value='America/Yakutat' Alaska Time - Alaska panhandle neck
option value='America/Nome' Alaska Time - west Alaska
option value='America/Adak' Aleutian Islands
option value='Pacific/Honolulu' Hawaii

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time

2004-10-13 Thread Robby Russell
On Wed, 2004-10-13 at 10:31 -0400, Jerry Swanson wrote:
 I want to send email every 24. What time format you recomend to use? 
 In what format the data should be store in mysql?
 
 TH
 

every 24? hours? minutes?

Are you going to be running a script all the time to do this?
You might want to consider using CRONTAB (if in the *nix
environment)...which would call a script to send your email.

-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting  Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] time

2004-10-13 Thread Greg Donald
On Wed, 13 Oct 2004 10:31:54 -0400, Jerry Swanson [EMAIL PROTECTED] wrote:
 I want to send email every 24. What time format you recomend to use?
 In what format the data should be store in mysql?

Your question is more appropriate for php-db or a MySQL list serv.

I'm not sure why you need to store the time in MySQL at all.  If the
mail needs to go every 24 hours, it seems more like a job for cron.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time consumed in microseconds

2004-08-31 Thread Karam Chand
Darn missed it. Looking into the docs I am using code
somthing like this:

$start   = microtime();
$result  = mysql_query ( $query, $mysql );
$end = microtime();

$diff   =  microtime_diff ($start, $end);

function microtimdiff() is given by:

function microtime_diff($a, $b)
{
   list($a_dec, $a_sec) = explode( , $a);
   list($b_dec, $b_sec) = explode( , $b);

   return ((float)$b_sec - (float)$a_sec +
(float)$b_dec - (float)$a_dec);
}

The result from one operation is like:

$start = 0.26562800 1093931165
$end = 0.26813400 1093931165
$diff = 0.002506

So to get the difference in ms I have to multilply
$diff by 1000. 

Am I correct?

Regards,
Karam

--- John Holmes [EMAIL PROTECTED] wrote:

 Karam Chand wrote:
  In Win32 API to profile a job we use the following
  method:
  
  
   timetaken = GetTickCount();
   /* do some job */
   timetaken = GetTickCount() - timetaken;
  
  In this way timetaken returns you the time taken
 by
  the job to complete?
  
  How can I get it in PHP. I want the exact figure
 in
  ms? I used microtime() and the samples given in
  php.net but none of them correctly returns the
  difference only in ms?
 
 Read the manual page again. Use the example to get
 the microtime as a 
 float at the start and then after your job. Subtract
 to get the 
 difference. If you're using PHP5, just use
 microtime(TRUE); to get the 
 float value.
 
 -- 
 
 ---John Holmes...
 
 Amazon Wishlist:
 www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals –
 www.phparch.com
 
 
 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time consumed in microseconds

2004-08-31 Thread raditha dissanayake
Karam Chand wrote:
Darn missed it. Looking into the docs I am using code
somthing like this:
 

If you are really keen about chaning +1 to ++  and double quotes to 
single quotes in the hope of shaving off a few milliseconds in execution 
time you might want to try something like xdebug.

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Time consumed in microseconds

2004-08-30 Thread John Holmes
Karam Chand wrote:
In Win32 API to profile a job we use the following
method:
 timetaken = GetTickCount();
 /* do some job */
 timetaken = GetTickCount() - timetaken;
In this way timetaken returns you the time taken by
the job to complete?
How can I get it in PHP. I want the exact figure in
ms? I used microtime() and the samples given in
php.net but none of them correctly returns the
difference only in ms?
Read the manual page again. Use the example to get the microtime as a 
float at the start and then after your job. Subtract to get the 
difference. If you're using PHP5, just use microtime(TRUE); to get the 
float value.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] time function

2004-03-25 Thread Burhan Khalid
Matthew Oatham wrote:
Hi,

I have a TIME field type in mysql database I want to do a select and add all the times together to return a total time, can I do this using the select statement?

cheers
This is a PHP list, not MySQL.

http://www.mysql.com/doc/en/DATETIME.html

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] time function

2004-03-25 Thread Angelo Zanetti
select sum(mytime) from table...

not sure if it will work but try it!

angelo

-Original Message-
From: Matthew Oatham [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 1:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] time function


Hi,

I have a TIME field type in mysql database I want to do a select and add all
the times together to return a total time, can I do this using the select
statement?

cheers

matt


Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time delay function?

2004-03-09 Thread Richard Davey
Hello Scott,

Wednesday, March 10, 2004, 4:12:29 AM, you wrote:


ST I am wondering if there is a time delay function, one that will cause
ST the program to be inactive for a number of seconds (something like
ST delay(10) ).  I am doing this because I am setting up a mass mailing
ST program (this is not spam), and I don't want to be targeted as spam.

Time for sleep()

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] time delay function?

2004-03-09 Thread Jason Sheets
Take a look at sleep()

http://www.php.net/sleep

It delays execution by a user specified number of seconds.

Jason 

-Original Message-
From: Scott Taylor [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 09, 2004 9:12 PM
To: [EMAIL PROTECTED]
Subject: [PHP] time delay function?


I am wondering if there is a time delay function, one that will cause the
program to be inactive for a number of seconds (something like
delay(10) ).  I am doing this because I am setting up a mass mailing program
(this is not spam), and I don't want to be targeted as spam.

Best Regards,

Scott Taylor

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Time

2003-11-25 Thread Wouter van Vliet
Fernando Melo wrote:
 Hi there,
 
 I have a RH Linux Web server  running apache and PHP.
 
 I recently changed the system clock, the time zone and hardware clock.
 The time and date are showing up correctly in Webmin and in
 the O/S itself.
 But when I call a php function to display the date and time
 it shows it as one hour behind!
 
 How do I fix this?
 
 Regards
 Fernando

Must be something with your locale settings. Probably your sytem clock is
set to the GMT time, while you are in GMT+1 yourself. Not really sure how to
fix this, but this might be something that helps you find the solution. Let
me know !

Wouter

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Time

2003-11-25 Thread Fernando Melo
I have done all those checks. Thanks for trying though.
Anyone else have any suggestions please? :(

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 25 November 2003 16:06
To: [EMAIL PROTECTED]
Subject: AW: [PHP] Time

Hi Fernando,
first try date and date -u in a shell. That's the local and UTC-time.
Write a testscript to show time and timezone in PHP without calculations.

Check /etc/timezone. It can be that you must create it.

Sri, no more ideas on the fly. It's a little bit complex to manage all
features.

Hope some checks are good for your search...

Greetings,
Tobias



-Ursprüngliche Nachricht-
Von: Fernando Melo [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 25. November 2003 11:20
An: '[EMAIL PROTECTED]'
Betreff: [PHP] Time


Hi there,

I have a RH Linux Web server  running apache and PHP.

I recently changed the system clock, the time zone and hardware clock.
The time and date are showing up correctly in Webmin and in the O/S itself.
But when I call a php function to display the date and time it shows it as
one hour behind!

How do I fix this?

Regards
Fernando

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Time

2003-11-25 Thread Fernando Melo

Hi,

I found the problem.  If you change the time zone on your Linux server
running Apache and PHP, you need to Stop and then Start Apache else the PHP
(or Apache) will still pick up the old time zone.

Thanks anyway

-Original Message-
From: Wouter van Vliet [mailto:[EMAIL PROTECTED] 
Sent: 25 November 2003 13:13
To: 'Fernando Melo'; [EMAIL PROTECTED]
Subject: RE: [PHP] Time

Fernando Melo wrote:
 Hi there,
 
 I have a RH Linux Web server  running apache and PHP.
 
 I recently changed the system clock, the time zone and hardware clock.
 The time and date are showing up correctly in Webmin and in
 the O/S itself.
 But when I call a php function to display the date and time
 it shows it as one hour behind!
 
 How do I fix this?
 
 Regards
 Fernando

Must be something with your locale settings. Probably your sytem clock is
set to the GMT time, while you are in GMT+1 yourself. Not really sure how to
fix this, but this might be something that helps you find the solution. Let
me know !

Wouter

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] time out for mysql_connect

2003-11-21 Thread Marek Kilimajer
Diana Castillo wrote:

Is there anyway to set a time out on this command:
mysql_connect($host, $UN, $PW);
so that if it can´t connect after a certain amount of time, it returns an
error and the program continues?
ini_set('mysql.connect_timeout', ... );

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Time problem

2003-11-11 Thread Chris Shiflett
--- Erin [EMAIL PROTECTED] wrote: 
 How do i convert a timestamp in to a normal readable time  date ie
 
 2003155023
 
 into
 
 11th November 2003 @ 15:50:23

That's not a timestamp, first of all. It looks to me like you just need to
use substr() to parse out the elements however you want. You can see if
strtotime() can do anything with it, but I doubt it.

If you want to convert it to a real timestamp, look at the mktime()
function. Once you have a timestamp, it's very easy to work with, and you
can use date() to format it however you want.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   >