Re: [PHP] time()

2001-03-06 Thread Philip Olson

Hi Augusto,

This is a quick hack (nobody freak out please!) that will hopefully
explain this question and your other recent thread.  Without further ado, 
play with this :

 60*60*24,
  'week'   => 60*60*24*7,
  'month'  => 60*60*24*30,
  'year'   => 60*60*24*365,
  'decade' => 60*60*24*365*10);

testTime($seconds);

function testTime($times,$format='l dS of F Y h:i:s A')
{
echo 'Current time() : '. time();

echo 'Future Times';
foreach ($times as $type => $value) {

echo ''. $type . ' : ' . date($format,time()+$value);
}
echo '';

echo 'Past Times';
foreach ($times as $type => $value) {

echo ''. $type . ' : ' . date($format,time()-$value);
}
echo '';
} 

?>

If it doesn't make sense, just say so.  But essentially, timestamps are
very cool and important!  Time() returns such a beast.  It returns the
number of seconds since this date, we call it the EPOCH (*bows*)  :

January 1 1970 00:00:00 GMT

Read about it here :

http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=epoch


Regards,

Philip Olson
http://www.cornado.com/

On Tue, 6 Mar 2001, Augusto Cesar Castoldi wrote:

> I'm trying to do a session with MySQL.
> 
> how works the funtion time? I didn't undertood the manual.
> 
> that number is a date, time, seconds?? What is it?
> 
> regards,
> 
> Augusto
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] time

2001-06-20 Thread Ray Hilton

well, if its a server side script, the only clock available to it is the
one on the server...

Ray

-Original Message-
From: Jon Yaggie [mailto:[EMAIL PROTECTED]]
Sent: 20 May 2001 15:51
To: [EMAIL PROTECTED]
Subject: [PHP] time


quickly can some one tell me if time() return server or usersystem time?




Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] time

2001-06-20 Thread SED

I would guess server-time because the PHP is server-based and is
processed before the user gets it :)
 
SED

-Original Message-
From: Jon Yaggie [mailto:[EMAIL PROTECTED]] 
Sent: 20. maí 2001 13:51
To: [EMAIL PROTECTED]
Subject: [PHP] time


quickly can some one tell me if time() return server or usersystem time?
 
 
 
 
Thank You,
 
Jon Yaggie
www.design-monster.com
 
And they were singing . . . 
 
'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code
 
101 little bugs in the code . . .'
 
And it continued until they reached 0
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] time

2001-06-20 Thread Pavel Jartsev

> Jon Yaggie wrote:
> 
> quickly can some one tell me if time() return server or usersystem
> time?
> 

Server time.

-- 
Pavel a.k.a. Papi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] time

2001-06-21 Thread Don Read


On 20-Jun-01 Ray Hilton wrote:
> well, if its a server side script, the only clock available to it is the
> one on the server...
> 


Errmm ...

putenv('TZ=PST8PDT');  //  default to Pacific time
if (isset($usertz))
   putenv("TZ=$usertz");
  
$dtstr= date('Y-m-d h:i');

   ...
  
> -Original Message-
> From: Jon Yaggie [mailto:[EMAIL PROTECTED]]
> Sent: 20 May 2001 15:51
> To: [EMAIL PROTECTED]
> Subject: [PHP] time
> 
> 
> quickly can some one tell me if time() return server or usersystem time?
> 

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Time

2002-01-08 Thread Martin Towell

date("d M Y, H:i:s", $replyby);

-Original Message-
From: Necro [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 4:27 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Time


How can I make a variable which is the current time + 48 hrs??

I had $replyby = time() + 172800;
But that returns time in seconds. How can I then format that $replyto into
day month year, HH:MM:SS ??

Andrew Duck



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP] time

2002-05-27 Thread Jason Wong

On Monday 27 May 2002 20:42, Chris Grigor wrote:
> howdi all
>
> anyone know how to get a simple time print ? all the functions I have
> looked at gmtime() time() dont give the right thing ... all I want
> is a simple time print e.g 17:51
>
> I know that there is an easy way, Im just missing it somewhere ...

date() ?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Every time I look at you I am more convinced of Darwin's theory.
*/


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




RE: [PHP] time

2002-05-27 Thread Roman Duriancik

try echo Date("H:i:s");

roman


-Original Message-
From: Chris Grigor [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 27, 2002 2:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] time 


howdi all 

anyone know how to get a simple time print ? all the functions I have 
looked at gmtime() time() dont give the right thing ... all I want
is a simple time print e.g 17:51

I know that there is an easy way, Im just missing it somewhere ...

Chris

-- 
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

2001-08-21 Thread speedboy

> hi.
> how do I can wrk with time:
> 
> 11:56:23 - 10:00:45 =

Don't ask this again.

Date: Mon, 20 Aug 2001 19:14:41 +1000 (EST)
From: speedboy <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [PHP] time in php

> hi.
> how I compare two times with php?
>  12:23:50 - 13:12:00 = ???

Convert them to timestamps (unix timestamps) and subtract the two.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] time

2001-08-21 Thread David Robley

On Thu, 23 Aug 2001 16:11, nafiseh saberi wrote:
> hi.
> how do I can wrk with time:
>
> 11:56:23 - 10:00:45 =
>
> thanks.

Have a look at the date and time functions - convert the time to seconds 
and do the calculation (mktime) then turn it back to whatever format you 
like.

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   REALITY.SYS corrupted: Reboot universe? (Y/N/A)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




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

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-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()

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

2003-09-02 Thread Nicholas Robinson
Not directly as far as I know. Try using chronyd or similar (google will point 
you in the right direction). This works well with one of my machines that has 
a wayward clock and chronyd is happy to work with networks not permanently 
connected to the internet.

On Tuesday 02 Sep 2003 1:11 am, Dale Hersh wrote:
> The battery on my server keeps on dieing, so the clock is not keeping time
> correctly. I was wondering is there any way to query some type of global
> time source in php?
>
> Thanks,
> Dale

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



Re: [PHP] TIME

2003-09-02 Thread Curt Zirzow
* Thus wrote Dale Hersh ([EMAIL PROTECTED]):
> The battery on my server keeps on dieing, so the clock is not keeping time
> correctly. I was wondering is there any way to query some type of global
> time source in php?

Totally unrealated to php but search for:

 Network Time Protocol (NTP) 

That will keep your clocks in sync.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
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

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 problem

2001-02-07 Thread Steve Werby

"Roman" <[EMAIL PROTECTED]> wrote:
> I have one problem with mysql database. In table i have 2 arrays with time
> format.
> For example this arrays calls IN and OUT. In php script i want to have
> distinction between
> this arrays. For example IN is 8:30:45 and OUT is 16:45:15 and result
> will be: 8:14:30. Exists any function which do this. Tnanx.

If your MySQL fields are a datetime type (-MM-DD hh:mm:ss) then you can
convert them to seconds since epoch (Jan 1, 1970 at midnight) and then
calculate the difference and divide by a number to get appropriate units.
Below is a set of functions I wrote to do that.  Before I get to that here's
a simpler solution:

// $time = "16:45:15";
$time_array = explode( ":", $time);
// $time[0] = 16, $time[1] = 45, $time[2] = 15
$time_since_midnight = $time[0] * 3600 + $time[1] * 60 + $time[2];
// Do this conversion for both times, subtract and convert units.

function get_mysql_to_epoch( $date )
{
list( $year, $month, $day, $hour, $minute, $second ) = split(
"([^0-9])", $date );
return date( "U", mktime( $hour, $minute, $second, $month, $day,
$year ) );
}

function get_elapsed_time( $time_start, $time_end, $units = "seconds",
$decimals = "2" )
{
$divider[years]   = ( 60 * 60 * 24 * 365 );
$divider[months]  = ( 60 * 60 * 24 * 365 / 12 );
$divider[weeks]   = ( 60 * 60 * 24 / 7 );
$divider[days]= ( 60 * 60 * 24 );
$divider[hours]   = ( 60 * 60 );
$divider[minutes] = ( 60 );
$divider[seconds] = 1;

$elapsed_time = ( ( get_mysql_to_epoch( $time_end ) -
get_mysql_to_epoch( $time_start ) )
  / $divider[$units] );
$elapsed_time = sprintf( "%0.{$decimals}f", $elapsed_time );

return $elapsed_time;
}

Days: ";
echo get_elapsed_time( $time_in, $time_out, "days", "3" );
// Use defaults for units and decimal places.
echo "Seconds: ";
echo get_elapsed_time( $time_in, $time_out );
?>

--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Time problem

2001-02-07 Thread php3

Addressed to: "Steve Werby" <[EMAIL PROTECTED]>
  "Roman" <[EMAIL PROTECTED]>
  "Php-General" <[EMAIL PROTECTED]>

** Reply to note from "Steve Werby" <[EMAIL PROTECTED]> Wed, 7 Feb 2001 09:28:29 
-0500

Or you could do it the easy way in MySQL:

SELECT SEC_TO_TIME( TIME_TO_SEC( OUT ) - TIME_TO_SEC( IN )) AS Hours,
..
..
..

This requires IN and OUT to be type TIME.




>
> "Roman" <[EMAIL PROTECTED]> wrote:
> > I have one problem with mysql database. In table i have 2 arrays with time
> > format.
> > For example this arrays calls IN and OUT. In php script i want to have
> > distinction between
> > this arrays. For example IN is 8:30:45 and OUT is 16:45:15 and result
> > will be: 8:14:30. Exists any function which do this. Tnanx.
>
> If your MySQL fields are a datetime type (-MM-DD hh:mm:ss) then you can
> convert them to seconds since epoch (Jan 1, 1970 at midnight) and then
> calculate the difference and divide by a number to get appropriate units.
> Below is a set of functions I wrote to do that.  Before I get to that here's
> a simpler solution:
>
> // $time = "16:45:15";
> $time_array = explode( ":", $time);
> // $time[0] = 16, $time[1] = 45, $time[2] = 15
> $time_since_midnight = $time[0] * 3600 + $time[1] * 60 + $time[2];
> // Do this conversion for both times, subtract and convert units.
>
> function get_mysql_to_epoch( $date )
> {
> list( $year, $month, $day, $hour, $minute, $second ) = split(
> "([^0-9])", $date );
> return date( "U", mktime( $hour, $minute, $second, $month, $day,
> $year ) );
> }
>
> function get_elapsed_time( $time_start, $time_end, $units = "seconds",
> $decimals = "2" )
> {
> $divider[years]   = ( 60 * 60 * 24 * 365 );
> $divider[months]  = ( 60 * 60 * 24 * 365 / 12 );
> $divider[weeks]   = ( 60 * 60 * 24 / 7 );
> $divider[days]= ( 60 * 60 * 24 );
> $divider[hours]   = ( 60 * 60 );
> $divider[minutes] = ( 60 );
> $divider[seconds] = 1;
>
> $elapsed_time = ( ( get_mysql_to_epoch( $time_end ) -
> get_mysql_to_epoch( $time_start ) )
>   / $divider[$units] );
> $elapsed_time = sprintf( "%0.{$decimals}f", $elapsed_time );
>
> return $elapsed_time;
> }
>
>  // Usage example
> $time_in  = "2000-06-14 06:30:00";
> $time_out = "2000-12-22 13:45:00";
> // Full use of function.
> echo "Days: ";
> echo get_elapsed_time( $time_in, $time_out, "days", "3" );
> // Use defaults for units and decimal places.
> echo "Seconds: ";
> echo get_elapsed_time( $time_in, $time_out );
> ?>
>
> --
> Steve Werby
> COO
> 24-7 Computer Services, LLC
> Tel: 804.817.2470
> http://www.247computing.com/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Time problem

2001-02-08 Thread Steve Werby

<[EMAIL PROTECTED]> wrote:
> Or you could do it the easy way in MySQL:
>
> SELECT SEC_TO_TIME( TIME_TO_SEC( OUT ) - TIME_TO_SEC( IN )) AS Hours,
> This requires IN and OUT to be type TIME.

That is a pretty sweet function and it's definitely faster to handle the
conversion in MySQL instead of PHP.  My example was for a datetime MySQL
field as opposed to a plain time field.  Like Rick Widmer stated, usage of
TIME_TO_SEC() only works correctly on time fields.  If your data is a
datetime field you can use UNIX_TIMESTAMP() to convert a field to seconds
since epoch.  Do that for two fields take the difference and divide by a
constant to convert into desired time units.

SELECT UNIX_TIMESTAMP("2001-01-14 16:49:34") => 979508974

--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Time Help

2001-07-01 Thread Jeff Lewis

Here is the function I use when I am comparing differences ($now and $old
are Unix timestamps):

function datediff($now, $old)
{

  $DIS = $now - $old;   // Diff In Secs
  $secs = $DIS % 60; // modulo
  $DIS -= $secs;
  $days = floor($DIS / (24*60*60));
  $DIS -= $days * (24*60*60);
  $hours = floor($DIS / (60*60));
  $DIS -= $hours * (60*60);
  $mins = floor($DIS / 60);
  $DIS -= $mins * 60;
  $diffstr= "$days Days, $hours Hours, $mins Minutes, $secs Seconds";
  return $diffstr;
}

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 01, 2001 11:11 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Time Help
>
>
> Hi,
>
> I`m trying to get the difference between two date/times and then
> state how
> many days, hours and minutes there are between them.
>
> So I take my date and convert it into unix time. Then get the
> current time,
> and then subtract the two to get the current difference in unix
> seconds. What
> I`m having trouble doing is working out how many days hours and
> minutes are
> left over.
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Time Help

2001-07-01 Thread KPortsmout

Thanks Jeff,

Thats just the job.

Ade

<< Here is the function I use when I am comparing differences ($now and $old
 are Unix timestamps):
 
 function datediff($now, $old)
 {
 
   $DIS = $now - $old;  // Diff In Secs
   $secs = $DIS % 60; // modulo
   $DIS -= $secs;
   $days = floor($DIS / (24*60*60));
   $DIS -= $days * (24*60*60);
   $hours = floor($DIS / (60*60));
   $DIS -= $hours * (60*60);
   $mins = floor($DIS / 60);
   $DIS -= $mins * 60;
   $diffstr= "$days Days, $hours Hours, $mins Minutes, $secs Seconds";
   return $diffstr;
 } >>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Time Stamp

2002-09-18 Thread 1LT John W. Holmes

MySQL syntax is MMDDHHMMSS or "-MM-DD HH:MM:SS"

---John Holmes...

- Original Message -
From: "Chuck Payne" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 18, 2002 11:25 AM
Subject: [PHP] Time Stamp


> Hi,
>
> I have a form that I am using to update a mysql table but I can get
> timestamp to update. How can I pass that information to pass on. I have
> "READ" all books and feel I have correct systax but it just not working...
>
> 
>
> This should pass the time right?
>
> Chuck Payne
> Magi Design and Support
>
>
>
>
> --
> 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

2002-09-18 Thread Savaidis



Hello all!

I use time() to keep UNIX seconds from 1970 to a timestamp(14) MySQL field.
But when I read it (Dt_last) it is TO big compearing with "today=time()" in
a php script that is only some seconds later.
today : 1032350421 Dt_last: 20001101165838

What can I do?
Thanks!
Makis



Makis



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




RE: [PHP] time() problem

2002-09-18 Thread Adam Voigt

Change it to an INT or a VARCHAR datatype, the mysql timestamp field
uses MySQL's date/time formmating. If you decide to let MySQL use it's
own date time format, use UNIX_TIMESTAMP(fieldname) to get the unix
timestamp from that date field.

Adam Voigt
[EMAIL PROTECTED]

On Wed, 2002-09-18 at 13:19, Savaidis wrote:
> 
> 
> Hello all!
> 
> I use time() to keep UNIX seconds from 1970 to a timestamp(14) MySQL field.
> But when I read it (Dt_last) it is TO big compearing with "today=time()" in
> a php script that is only some seconds later.
> today : 1032350421 Dt_last: 20001101165838
> 
> What can I do?
> Thanks!
> Makis
> 
> 
> 
> Makis
> 
> 
> 
> -- 
> 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 question

2002-03-30 Thread J. Scott Johnson

Why wouldn't you use gmdate: 

http://www.php.net/manual/en/function.gmdate.php

and then increment it yourself by an offset?

Scott

-Original Message-
From: anders nawroth [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 30, 2002 5:05 PM
To: [EMAIL PROTECTED]
Subject: [PHP] time question


How do I get the current time() for Central European Time
(= GMT +01:00).
I want it to work wherever the server stands.
How can I get the difference between server time
and GMT, for instance?

A. Nawroth



-- 
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 question.

2002-07-26 Thread 1LT John W. Holmes

> How do I compare time in php?
>
> Eg. If I have a mysql time field I retrieve stored in $result[0][0] how do
I
> say :
>
> if (($result[0][0] > $result[0][0] plus ten minutes) && ($result[0][0] >
> '00:00:00')){

MySQL and PHP timestamps are in different formats. MySQL uses MMDDHHMMSS
and PHP uses a unix timestamp, the number of seconds since January 1st,
1970.

You can use UNIXTIMESTAMP(your_column) in your query to get a PHP style unix
timestamp.

Although, if you explain what you are trying to do a little better, you
could probably do the comparisons a lot easier in your query and not involve
PHP at all.

SELECT * FROM your_table WHERE your_column > your_column + INTERVAL 10
MINUTE AND your_column != 0

That looks equivilent to what you're trying to do in PHP. You might have to
say your_column+0 != 0 to get your_column as an integer and not a string.

---John Holmes...


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




Re: [PHP] Time problem

2001-08-08 Thread Gianluca Baldo

Pierre -
py> In other words, how do you change this 997271630.08651
py> in 08:14:32 ?
you can use date() in conjunction with mktime().
Have a look at the manual there are good examples and users comments there.

Cheers,
   Gianluca

[EMAIL PROTECTED]

BcnInédita
EURO RSCG INTERACTION
www.bcninedita.com
Planella, 39
08017 Barcelona
Tel.34 932 531 950 (directo 93 253 19 53)
Fax. 34 932 114 546 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Time problem

2001-08-08 Thread pierre-yves

Thanks, I feel a bit moron ;) it seems like I missed it while reading the
manuel,
sometimes the solution is so obvious that it becomes trivial!
py


- Original Message -
From: "Thomas Schmid" <[EMAIL PROTECTED]>
To: "'pierre-yves'" <[EMAIL PROTECTED]>
Sent: Wednesday, August 08, 2001 8:23 AM
Subject: AW: [PHP] Time problem


Take the date() function ;-)

-Ursprüngliche Nachricht-
Von: pierre-yves [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 8. August 2001 14:19
An: [EMAIL PROTECTED]
Betreff: [PHP] Time problem

Hello,
I convert the time in seconds to do some calculations, now I want
to convert a number of seconds in a presentable HH:MM:SS format.

In other words, how do you change this 997271630.08651
in 08:14:32 ?

py

p.s. I use this to get the number of seconds.
function getmicrotime() {
  $temparray=split(" ",microtime());
  $returntime=$temparray[0]+$temparray[1];
  return $returntime;
}






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Time Wrong

2009-01-21 Thread Edmund Hertle
2009/1/21 Gary 

> Im pretty new with php, so this might be a pretty novice mistake, but the
> time displays wrong on two computers.
>
>  
>
> 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 


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

 

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"  wrote in message 
news:49779f04.4060...@gmail.com...
> Edmund Hertle wrote:
>> 2009/1/21 Gary 
>>
>>> Im pretty new with php, so this might be a pretty novice mistake, but 
>>> the
>>> time displays wrong on two computers.
>>>
>>>  
>>>
>>> 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-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:



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-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."");
> 
>  $buffer_time = $currentTime;
>  for($i = 0; $i < $num_intervals; $i++)
>  {
>echo ("");
>echo ("".$currentTime."");
> 
>foreach ($days as $day)
>{
>echo ("");
>echo (" value=$day>");
> 
>echo ("");
>}
> 
> 
>$buffer_time += $interval;
>echo ("");
>  }
> 
> 
> 
> 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.

';

echo '';

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

  foreach ($days AS $day) {
echo '',
 '',
 $day,
 '';
  }
  # Don't forget to reset the $days array
  # otherwise the array pointer is at the last index
  reset($days);
  echo '';
}

echo '';

?>

-- 
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:



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 code!!!

2003-01-20 Thread Justin French
Please post in raw text, not HTML.



look in the manual to decide what format you need to replace 'd m y' with:

http://php.net/date


The welcome back bit all depends on cookies, sessions, how your login
scripts work, etc etc.


Justin


on 20/01/03 12:46 PM, Karl James ([EMAIL PROTECTED]) wrote:

> does anyone have the code to where i can have the time
> 
> printed on my home page like for example
> 
> 
> 
> 
> 
> Monday, January 19, 2003
> 
> 
> 
> also I want to have it state when the users login in
> 
> it says 
> 
> welcome back, (name)
> 
> 
> 
> any advise would be fantastic?
> 
> 
> 
> Thanks Karl


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




Re: [PHP] Time code!!!

2003-01-20 Thread Larry E. Ullman
does anyone have the code to where i can have the time
printed on my home page like for example
 Monday, January 19, 2003


The PHP Manual has this code, under the date() function 
(www.php.net/date).

echo date ("l, F j, Y");

 also I want to have it state when the users login in
it says
welcome back, (name)


The PHP Manual can help you out on this one, too: www.php.net/echo or 
www.php.net/ print

echo "welcome back, $username";


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



RE: [PHP] Time code!!!

2003-01-20 Thread David Freeman
Hi Karl

First up, would you mind posting your messages in plain text instead of
html format?  It's just a courtesy to the rest of us.

 > does anyone have the code to where i can have the time
 > printed on my home page like for example
 >
 > Monday, January 19, 2003

Sure, check out the date() function in the php manual - you can output
current date in just about any format you care to choose.

Something to consider though, the date that you get is based on the date
on the server - so if your server is in a different time zone to you
it'll look odd, ditto for someone viewing your page from a different
time zone.  Of course, if you and most people browsing your page are in
the same time zone that won't matter.  Also, you may want to display it
that way anyhow (I do it on some of my web sites to show what time it is
where the business who owns the site is located).

If you actually want to display local time for the person viewing the
web page then you'll need to use javascript and grab local date/time
from the local computer.

 > also I want to have it state when the users login in
 > it says welcome back, (name)

First thing you need to do is decide how you're going to store that
information.  Are you going to store user information in cookies?  In a
database?  Flat files?  Are you going to have the person log in before
you display the welcome?  Or are you trying to pick it up automatically?
How complex and how reliable do you want to have this capability?

 > any advise would be fantastic?

If you check the manual, particularly the fully annotated version at
http://www.php.net/ you'll find a wealth of examples and code snippets
that'll help you out.

CYA, Dave




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




Re: [PHP] Time Delay?

2003-02-01 Thread Jason Wong
On Saturday 01 February 2003 21:27, OjMyStEr wrote:
> Hi,
> Does anyone know if there is a way for me to produce a function in PHP to
> pause the processing of the script for 3 seconds for example without eating
> up the CPU bandwidth. I could do with quite accurate control. Is there a
> better way that doing it like this:

[snip]

Try sleep().

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
We wish you a Hare Krishna
We wish you a Hare Krishna
We wish you a Hare Krishna
And a Sun Myung Moon!
-- Maxwell Smart
*/


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




Re: [PHP] time() question

2003-03-13 Thread Larry E. Ullman
Is there an easy way to display the epoch time given by time() in a 
human
readable format? Basically, if I do $time = time(); and the insert that
data into my mysql database and then pull that information out again 
how
do I make it look like 2003-03-13 or a variant of that?
If you are pulling a date/time out of a MySQL database, use MySQL's 
DATE_FORMAT() function to format the value. For that matter, you can 
use MySQL's NOW() function (or others) when inserting the time.

Otherwise, just in PHP, you can use the DATE() function to format dates.

Larry

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


Re: [PHP] time() question

2003-03-13 Thread Tom Woody
On Thu, 13 Mar 2003 12:07:33 -0500
"Tom Ray" <[EMAIL PROTECTED]> wrote:

> Is there an easy way to display the epoch time given by time() in a
> human readable format? Basically, if I do $time = time(); and the
> insert that data into my mysql database and then pull that information
> out again how do I make it look like 2003-03-13 or a variant of that?
> 
in php you would do: (see
http://www.php.net/manual/en/function.date.php)
$date = date('Y-m-d',time());

in mysql you would do:
(http://www.mysql.com/doc/en/Date_and_time_functions.html)
select date_format('%Y-%m-%d', field) from table where ...;


-- 
Tom Woody
Systems Administrator

Don't throw your computer out the window, 
throw the Windows out of your computer! 


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



Re: [PHP] time() question

2003-03-13 Thread Ernest E Vogelsinger
At 18:07 13.03.2003, Tom Ray said:
[snip]
>Is there an easy way to display the epoch time given by time() in a human
>readable format? Basically, if I do $time = time(); and the insert that
>data into my mysql database and then pull that information out again how
>do I make it look like 2003-03-13 or a variant of that?
[snip] 

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


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



Re: [PHP] time calcs

2003-06-29 Thread Jason Wong
On Monday 30 June 2003 03:19, Larry R. Sieting wrote:
> I am trying to get a time calculation using:
>
>  $tot_time = ($data['end_time'] - $data['start_time']);
>
> The end_time & start_time are stored in a db as column type of time.
>
> I want to output the difference as a difference expressed in time
> format:  10:05:23 - 09:45:32 = 00:39:51
>
> Do I need to break the stored time values apart and do calcs on each
> segment?  I am not storing the calculated time.

Your DBMS may very well have time date/time functions built-in that can do 
this for you.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Include me out.
*/


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



Re: [PHP] time calcs

2003-06-30 Thread Wendell Brown
On Mon, 30 Jun 2003 07:31:59 -0500, Wendell Brown wrote:

>On Sun, 29 Jun 2003 15:19:56 -0400, Larry R. Sieting wrote:
>
>>I want to output the difference as a difference expressed in time 
>>format:  10:05:23 - 09:45:32 = 00:39:51
>
>Try this:
>
>
>$tot_time = ($data['end_time'] - $data['start_time']);
>
>echo strftime( "%H:%M:%S", $end_time ) . " - ";
>echo strftime( "%H:%M:%S", $start_time ) . " = ";
>echo gmstrftime( "%H:%M:%S", $tot_time );
>
>?>

E I used the wrong variables in the previous message.  I also
assumed that the start and end times are actually TIME and not strings
(which appears to be the case since you are subtracting one from the
other).  If the start and end AREN'T time types you would have to
convert them first.  You should be able to use 'strtotime' or mktime to
convert them to time type.

Also, the gmstrtime used above would limit the time to 24 hours.  If
there is a possibility that the difference in time might be more than
24 hours you can do something like this:

  printf( "%d days %s",  (int)($tot_time / 86400),   gmstrftime(
"%H:%M:%S", $tot_time ) );

So, here is what I probably should have posted:





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



Re: [PHP] Time Calcuations

2003-10-15 Thread John W. Holmes
Jake McHenry wrote:

Here's my problem: In my time calculations, I'm taking the time that
the user clocked out, minus the time they clocked in. I'm using the
time_to_sec function in mysql. I work very odd hours. If I clock in
say at 10pm, then clock out at 1am, the clock is majorly messed up. I
think it's because it's a new day. I thought that the time_to_sec
functon turned the time into seconds from 1980 or something like that,
so the date and time when returning to the function should be right...
Use a complete timestamp for the two times. That'll include a complete 
date and time that the worker clocked in and out. You can then convert 
them to unix timestamps, subtract them, and use sec_to_time() to 
determine the hours when it's needed. SUM() that up with a WHERE 
condition to limit the dates to the current week and you'll know how 
many hours you worked.

Or just store it in unix timestamp format to begin with. :)

--
---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 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



RE: [PHP] Time problem

2003-11-11 Thread Vail, Warren
Not sure how others would tackle this, but I would use something like

$readabledate = date("dS F Y @ H:i:s",
strtotime(substr($timestamp,0,4)."-"
 .substr($timestamp,4,2)."-"
 .substr($timestamp,6,2)." "
 .substr($timestamp,8,2).":"
 .substr($timestamp,10,2).":"
 .substr($timestamp,12,2)));

Not sure this is bug free, but it should change your timestamp (yes it is a
database timestamp) into the readable format you described.  It's yours to
debug.

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

Good luck,

Warren Vail

-Original Message-
From: Erin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 4:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Time problem


Hi All,
Sorry if this has been asked a 1000 times and if its easy to find in the
php manual but i cant seam to solve this.

How do i convert a timestamp in to a normal readable time & date ie

2003155023

into

11th November 2003 @ 15:50:23


Many thanks, thought id ask someone is bound to have a snippet for this.



Regards

All



Erin

-- 
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

2003-11-11 Thread John W. Holmes
Erin wrote:

Hi All,
Sorry if this has been asked a 1000 times and if its easy to find in the
php manual but i cant seam to solve this.
How do i convert a timestamp in to a normal readable time & date ie

2003155023

into

11th November 2003 @ 15:50:23
IFF the "timestamp" is coming from MySQL (which has that format), then 
you should use DATE_FORMAT() in your query to do the formatting.

--
---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 & session info

2001-03-20 Thread Chris Lee

edit php.ini for the expiry and the gc (garbage collection) percentage.


-- 

 Chris Lee
 [EMAIL PROTECTED]



""Peter Houchin"" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
on my server in /tmp it saves the session details ... but for some reason
it's keeping them there ... is there a way (hopefully with out doing a cron
job) that i can tell em to delete them selves after x number of hrs/mins?

Peter Houchin
[EMAIL PROTECTED]
=
 _  __   /\
/_/_/_\/  |_/  \
   /_/_/___  __  __   __  / \
   \_/_/_\  /_/ /_/ /_/  /_/  \   _ /
 ___\_\_\/ /_/_/_/ /_//\/_/\_/ \/\_/
 \_//_/_/ /_/_/_/ /_/ \/_/v
    
/_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
   /_/_ _/_/ __  __   __  /_/   __ __
  /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\/_//_/_/_/
 /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
/_/\_\/_/_/_/ /_/ \/_/ /_/ /_/\_\/_/_/_//_/_/_/
=
Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
* We rent the dot in .COM!  **



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Time Language Settings

2001-06-21 Thread Don Read


On 21-Jun-01 Ray Hilton wrote:
> How do I go arround getting php to output the time() function in a
> different language?  I have tried the setlocale() function to no avail,
> perhaps my system doesn't have the appropriate locale to do this?  If
> so, then how do install them on Red Hat 7?

check strftime() ?

(You _will_ need the appropriate LOCALE files in ../share/locale )

 RFC standard  
$charset=strtr($charset, '_', '-');
Header("Content-Language: $lang, en");
Header("Content-Type: text/html; charset=$charset");
}

function formattime($tm='') {
$fmtstr='%A, %B %e %l:%M%p %Z';

if (empty($tm))
$tm=mktime();
$ds=date('Y-m-d-h-i', $tm);
list ($y, $m, $d, $h, $n)=explode('-', $ds);
$datestr=strftime($fmtstr, mktime($h, $n, 0, $m, $d, $y)) ;
return($datestr);
}


initlocale('de_DE.DIS_8859-15');
print formattime);
?>


Regards,
--  
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Time out Errors?

2001-06-30 Thread Aral Balkan

I've been having the same problem with Apache 1.3.19 / PHP 4.0.5 running on
WinMe -- and not just with my scripts either: phpMyAdmin does it sometimes
too. So, I reckon that the problem is with the configuration.

Has anyone experienced this on Win2000? (I'm in the process of moving my
files to a Win2000 box so I'll you know when I do if the problem repeats.)

Aral :)

__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Time Zone Offset?

2002-01-13 Thread DL Neil

Marvin,

> I'm using the PHP date() function on my site, but since my hosting company
> (Pair Networks) is on the East Coast and I'm on the West Coast, everything
> shows as three hours later (for most of my visitors, anyway). Pair tells me
> there's no setting I can make on my account to change the server time zone.

=not competent to comment. Recommend a review of the php.ini file commands and even if 
you can't gain access to
that file on the server, the function which allows you to make a change to the PHP 
environment for the life of
the current script.

> Can anyone recommend a way to set an offset for the date() function in PHP?
> (I searched on php.net and couldn't find anything.)

=I run an international service, and would have had a massive headache if each client 
was to see things stated
in their own timezone. We agreed that each would make specifications in their own 
timezone (and language...) but
that all system output would be in GMT.

=To your question: read up on the time/date functions for GMT, convert all input and 
store all date/times as
GMT; and at retrieval time convert time/dates from GMT to whichever time zone you want 
to use. PS also takes
care of bi-annual summer time discontinuities too (should they apply to you).

=Regards,
=dn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] time to seconds

2002-09-18 Thread Warren Daly

if your data is in UNIX TIMESTAMP format:

$result = mysql_query("select * from table1;",$db);
while ($row = mysql_fetch_array($result)){
// convert seconds from epoch into human date //
$data[] = date("Hi",mktime(0,0,$row['duration'],1,1,1970));
}

so I guess using mktime to convert DATE into unix timestamp

///mktime to recreate the unix timestamp
$result = mysql_query("select * from table1;",$db);
while ($row = mysql_fetch_array($result)){
$data[] =  mktime($hours ,$minutes, $seconds,$month ,$day,$year);
}

to sum the row you would need to add something like this.

$result = mysql_query("select * from table1;",$db);
while ($row = mysql_fetch_array($result)){
$var = $row['duration']
$sum = $var + $sum
}
echo $sum

but I'm sure other people have much better ways of doing it:) it's a bit
early in the morning for me
hope this helps.
Warren 

-Original Message-
From: adi [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 9:55 AM
To: PHP-General
Subject: [PHP] time to seconds


 Hi, I have a table table1, with a column "Duration" time type(ex
00:12:30)
I want to make in PHP a sql selection:
SELECT * from table1 WHERE condition, and after that, to make sum of
values
of column "Duration" and display it.
Any Help?

How to transform time in seconds, with php functions?
tx




smime.p7s
Description: application/pkcs7-signature


Re: [PHP] time to seconds

2002-09-24 Thread mhafizm

select time_to_sec('00:12:30) ?? 
 
>  
> From: "adi" <[EMAIL PROTECTED]> 
> Date: 2002/09/18 Wed PM 04:54:31 CST 
> To: "PHP-General" <[EMAIL PROTECTED]> 
> Subject: [PHP] time to seconds 
>  
>  Hi, I have a table table1, with a column "Duration" time type(ex 00:12:30) 
> I want to make in PHP a sql selection: 
> SELECT * from table1 WHERE condition, and after that, to make sum of values 
> of column "Duration" and display it. 
> Any Help? 
>  
> How to transform time in seconds, with php functions? 
> tx 
>  
>  
>  

saYANg forever!


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




RE: [PHP] Time is off?

2002-09-25 Thread Jon Haworth

Hi Brandon,

> I did a basic script  and the 
> time is off in that script [...] I have checked the 
> server time and the server hardware clock.  

Well, date("h:I") means "display the hours (in 12-hour format), followed by
a colon, followed by a 1 or a 0 depending on whether daylight saving is in
effect", so you're unlikely to get the correct time from it ;-)

Give either date("h:ia") or date("H:i") a try - these are 12-hour and
24-hour times respectively.

Cheers
Jon

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




Re: [PHP] time of day

2002-10-03 Thread Kevin Stone

PHP can give you the server time, but for this I think it would be better to
have the user's local time, in which case Javascript would provide a better
solution.
-Kevin

- Original Message -
From: "Bryan Koschmann - GKT" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Thursday, October 03, 2002 3:43 PM
Subject: [PHP] time of day


> Hello,
>
> I was wondering if anyone has a good example of a way to do this. Kinda
> lame, but like if the time is between 8am and 12pm, say "good morning",
> between 12pm and 6pm, say good afternoon, and so on.
>
> I know this is probably pretty trivial, but I just wanted to see what
> ideas where out there.
>
> Thanks in advance!
>
> Bryan
>
>
> --
> 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 of day

2002-10-03 Thread Michael Sims

On Thu, 3 Oct 2002 14:43:37 -0700 (PDT), you wrote:

>Hello,
>
>I was wondering if anyone has a good example of a way to do this. Kinda
>lame, but like if the time is between 8am and 12pm, say "good morning",
>between 12pm and 6pm, say good afternoon, and so on.
>
>I know this is probably pretty trivial, but I just wanted to see what
>ideas where out there.

How about this:

function getgreetingtime() {

  $hour = date("G");

  switch(true) {
case($hour < 12):
  $time = "morning";
  break;
case($hour >= 12 && $hour < 18):
  $time = "afternoon";
  break;
case($hour >= 18):
  $time = "evening";
  break;
  }

  return $time;

}

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




Re: [PHP] time in php

2001-08-20 Thread speedboy

> hi.
> how I compare two times with php?
>  12:23:50 - 13:12:00 = ???

Convert them to timestamps (unix timestamps) and subtract the two.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] time/task reporting

2012-03-01 Thread Fatih P.
On Thu, Mar 1, 2012 at 10:43 AM, Robert Nilsson  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 out issue

2012-05-12 Thread Matijn Woudt
On Sat, May 12, 2012 at 9:42 PM, admin  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  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  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  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 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 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-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-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-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 
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 , known in the United
Kingdom  as 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-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 
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 , known in the United
Kingdom  as 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 
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 , known in the United
Kingdom  as 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 
>> 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 , known in the United
>> Kingdom  as 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 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 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.
> 
>for ($offset = 0; $offset <= 23; $offset++){
> $z = ???;
> echo "$z\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.

$z\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("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("$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...

Eastern Time
Eastern Time - Michigan - most locations
Eastern Time - Kentucky - Louisville area
Eastern Time - Kentucky - Wayne 
County
Eastern Standard Time - Indiana - most 
locations
Eastern Standard Time - Indiana - 
Crawford County
Eastern Standard Time - Indiana - Starke 
County
Eastern Standard Time - Indiana - 
Switzerland County
Central Time
Central Time - Michigan - Wisconsin border
Central Time - North Dakota - 
Oliver County
Mountain Time
Mountain Time - south Idaho & east Oregon
Mountain Time - Navajo
Mountain Standard Time - Arizona
Pacific Time
Alaska Time
Alaska Time - Alaska panhandle
Alaska Time - Alaska panhandle neck
Alaska Time - west Alaska
Aleutian Islands
Hawaii

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



RE: [PHP] time() & daylight savings

2003-11-03 Thread Jay Blanchard
[snip]
does anybody know how php handles daylight saving issues ? 
[/snip]

I am pretty sure that PHP does not 'handle' daylight savings issues at
all, but relies on the server settings for its time base.

--
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 in php problem....

2001-02-12 Thread Dave VanAuken

almost didn't respond to this given the wide dissemination and the
broad nature of the question

can't be done with any accuracy.

you could, create a session or uservariable...  have that transmitted
with a screen refresh, or anytime your consultant moves within the
site resetting an internal timestamp.

failure to retransmit via refresh or movement within a specified time
would cause expirey, have a function that logs the expirey date and
perform your other functions from there (thats the easy part)

This doesn't prevent your consultant from keeping a browser window
open so that it can refresh. You could use javascipt code on your page
with a popup window where your consultant would have to press submt to
be logged in as online every so often, but the annoyance factor would
be absurd.

In short, try pounding out a base from whence to work from...  you are
likely to get specific responses to specific questions or problems...
what you are currently asking for is a prepackaged solutions.

Dave

-Original Message-
From: Ng Kok Chun [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 3:11 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED];
"mailto:webmaster"@dark-library.com; [EMAIL PROTECTED]
Subject: [PHP] Time in php problem


hi... i need some help...

currently i doing web base programming ( econsultant )using php,
apache and mysql as well... now i facing a problem which i need :
1) get time when consultant log on
2) get time when consultant log off
3) calculate how long for the specified consultant been log on to the
web
4) accumulate all the time everyday
5) then multiple accumulate with working rate ( X ).
6.) finally output to web ( html form )

pls help !
thanks !


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Time in php problem....

2001-02-12 Thread PHPBeginner.com

All I can tell is that there's a pain of calculating when the user leaves
the site.

Let's say his connection drops. What's then? How do you know he didn't spend
on that page 7 hours?

I think you should have a file included in every page he visits which, using
sessions, adds the TimeStamp to the database.
Then you can see - if session exists means he continues, if not then this is
the first time he is in.
Something like that.
Put all in the database and play with it later-on.

As of the rest, I think you can do it all. The only concern is for you to
accept that his last record is a hit of a page (or log-of button) and not
his closing window.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Ng Kok Chun [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 5:11 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED];
"mailto:webmaster"@dark-library.com; [EMAIL PROTECTED]
Subject: [PHP] Time in php problem


hi... i need some help...

currently i doing web base programming ( econsultant )using php, apache and
mysql as well... now i facing a problem which i need :
1) get time when consultant log on
2) get time when consultant log off
3) calculate how long for the specified consultant been log on to the web
4) accumulate all the time everyday
5) then multiple accumulate with working rate ( X ).
6.) finally output to web ( html form )

pls help !
thanks !


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >