[PHP] PHP Time

2012-07-02 Thread Rob Weissenburger
Hello everyone,

  I know php time() gives the current unix time which you can format out to
a normal date and time. Is there a way to format a specific date and time
back to unix time?

Thanks for any help.



Re: [PHP] PHP Time

2012-07-02 Thread Daniel Brown
On Mon, Jul 2, 2012 at 4:00 PM, Rob Weissenburger r...@fiberuplink.com wrote:
 Hello everyone,

   I know php time() gives the current unix time which you can format out to
 a normal date and time. Is there a way to format a specific date and time
 back to unix time?

Yup.  Look at strtotime() and mktime():

http://php.net/strtotime
http://php.net/mktime

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] PHP Time

2012-07-02 Thread Geoff Shang

On Mon, 2 Jul 2012, Rob Weissenburger wrote:


 I know php time() gives the current unix time which you can format out to
a normal date and time. Is there a way to format a specific date and time
back to unix time?


mktime() and strtotime() will do it, depending on the form your time is 
in.  There's probably others.


Geoff.


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



RE: [PHP] PHP Time

2012-07-02 Thread Rob Weissenburger
That worked just perfectly. Thank you.

-Original Message-
From: paras...@gmail.com [mailto:paras...@gmail.com] On Behalf Of Daniel
Brown
Sent: Monday, July 02, 2012 3:02 PM
To: Rob Weissenburger
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Time

On Mon, Jul 2, 2012 at 4:00 PM, Rob Weissenburger r...@fiberuplink.com
wrote:
 Hello everyone,

   I know php time() gives the current unix time which you can format 
 out to a normal date and time. Is there a way to format a specific 
 date and time back to unix time?

Yup.  Look at strtotime() and mktime():

http://php.net/strtotime
http://php.net/mktime

--
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



[PHP] PHP time out for socket_recvfrom or socket_read block call

2008-06-14 Thread hce
Hi,

How can use time out mechanism in PHP when calling socket_recvfrom or
socket_read (in block service)?

I know the non-block system call can be used, but I need to use a
block system call, the block socket_recvfrom or socket_read should be
either returned to be failed, or canceled when a time out is occurred.

Thank you.

Kind Regards,

Jim

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



Re: [PHP] PHP time zone

2004-04-14 Thread David Robley
[EMAIL PROTECTED] (Tom Rogers) wrote in 
news:[EMAIL PROTECTED]:


 I have this in an auto_prepend file or you can put it before using any
 of the date() functions
 
 putenv('TZ=Australia/Brisbane');
 

But, but, that'll put the clock back 20 years and then add 30 minutes to 
Central Standard time :-)

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



[PHP] PHP time zone

2004-04-13 Thread nabil
how can get a specific time zone, not the server time.

example:
if the server time is 13:15:46  I need to output that time +5hours
so 18:15:46

because the hosting server time  is not my local or other area time..

thanks

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



Re: [PHP] PHP time zone

2004-04-13 Thread Red Wingate
Best:

use gmmktime() and add the required offset by:

$time_here = gmmktime() + ( $offset * 60 * 60 ) ;

 how can get a specific time zone, not the server time.

 example:
 if the server time is 13:15:46  I need to output that time +5hours
 so 18:15:46

 because the hosting server time  is not my local or other area time..

 thanks

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



Re: [PHP] PHP time zone

2004-04-13 Thread Tom Rogers
Hi,

Tuesday, April 13, 2004, 9:29:19 PM, you wrote:
n how can get a specific time zone, not the server time.

n example:
n if the server time is 13:15:46  I need to output that time +5hours
n so 18:15:46

n because the hosting server time  is not my local or other area time..

n thanks


I have this in an auto_prepend file or you can put it before using any
of the date() functions

putenv('TZ=Australia/Brisbane');

-- 
regards,
Tom

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