473,491 Members | 2,221 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Time.....

Hi Guys:

I am pretty new to this so forgive me it is it a silly question....
I am setting a 15 minute cookie using time()+900.
This works but I would like to inform the user of the expiration time in a
hh:mm format...

What I need to know is how to convert time()+900 into HH:MM.

Thanks in advance..

MP
Jul 17 '05 #1
5 1808
On Mon, 2 Feb 2004 21:46:43 +0000 (UTC), "Max Power"
<Ma*******@excelence.co.uk> wrote:
What I need to know is how to convert time()+900 into HH:MM.


http://www.php.net/date
--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
Jul 17 '05 #2
Thanks for that Andy.

I did have a look on php.net but only time()....
We live and learn.....

Thanks again.

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:t5********************************@4ax.com...
On Mon, 2 Feb 2004 21:46:43 +0000 (UTC), "Max Power"
<Ma*******@excelence.co.uk> wrote:
What I need to know is how to convert time()+900 into HH:MM.


http://www.php.net/date
--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>

Jul 17 '05 #3
$the_time_you_want = date("Y-m-d H:i:s",(time+900));

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:t5********************************@4ax.com...
On Mon, 2 Feb 2004 21:46:43 +0000 (UTC), "Max Power"
<Ma*******@excelence.co.uk> wrote:
What I need to know is how to convert time()+900 into HH:MM.


http://www.php.net/date
--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>

Jul 17 '05 #4
Sorry, my bad. This will add 15 mins to the time.

<?

$i = date("i") + ('15');
$today = date("H:$i:s");
echo $today;

?>
"Philip D Heady" <pd*****@comcast.net> wrote in message
news:0Q****************@news.uswest.net...
$the_time_you_want = date("Y-m-d H:i:s",(time+900));

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:t5********************************@4ax.com...
On Mon, 2 Feb 2004 21:46:43 +0000 (UTC), "Max Power"
<Ma*******@excelence.co.uk> wrote:
What I need to know is how to convert time()+900 into HH:MM.


http://www.php.net/date
--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>


Jul 17 '05 #5
On Mon, 2 Feb 2004 17:27:19 -0500, "Philip D Heady" <pd*****@comcast.net>
wrote:
"Philip D Heady" <pd*****@comcast.net> wrote in message
news:0Q****************@news.uswest.net...
"Andy Hassall" <an**@andyh.co.uk> wrote in message
On Mon, 2 Feb 2004 21:46:43 +0000 (UTC), "Max Power"

>What I need to know is how to convert time()+900 into HH:MM.

http://www.php.net/date
$the_time_you_want = date("Y-m-d H:i:s",(time+900));


Sorry, my bad. This will add 15 mins to the time.

$i = date("i") + ('15');
$today = date("H:$i:s");


No it won't, it'll be wrong if it's currently 45 minutes past the hour or
later. The OP was correct to stick with adding 900 seconds to a Unix timestamp
and then formatting it afterwardws.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2937
by: Bart Nessux | last post by:
am I doing this wrong: print (time.time() / 60) / 60 #time.time has been running for many hours if time.time() was (21600/60) then that would equal 360/60 which would be 6, but I'm not getting...
5
3629
by: David Stockwell | last post by:
I'm sure this has been asked before, but I wasn't able to find it. First off I know u can't change a tuple but if I wanted to increment a time tuple by one day what is the standard method to do...
6
12859
by: David Graham | last post by:
Hi I have asked this question in alt.php as the time() function as used in setcookie belongs to php - or does it belong equally in the javascript camp - bit confused about that. Anyway, can anyone...
3
3132
by: Szabolcs Nagy | last post by:
I have to measure the time of a while loop, but with time.clock i always get 0.0s, although python manual sais: "this is the function to use for benchmarking Python or timing algorithms" So i...
6
2827
by: Rebecca Smith | last post by:
Today’s question involves two time text boxes each set to a different time zone. Initially txtCurrentTime will be set to Pacific Time or system time. This will change with system time as we travel...
3
2674
by: luscus | last post by:
Thanks for all the responses on my first question. Unfortunately the answers I was given were too complicated for my small brain , and neophite condition to understand. So if you could talk down to...
3
2011
by: cj | last post by:
If I want to check to see if it's after "11:36 pm" what would I write? I'm sure it's easy but I'm getting tired of having to work with dates and times. Sometimes I just want time or date. And...
1
14578
by: davelist | last post by:
I'm guessing there is an easy way to do this but I keep going around in circles in the documentation. I have a time stamp that looks like this (corresponding to UTC time): start_time =...
2
19563
by: Roseanne | last post by:
We are experiencing very slow response time in our web app. We run IIS 6 - windows 2003. I ran iisstate. Here's what I got. Any ideas?? Opened log file 'F:\iisstate\output\IISState-812.log'...
9
8280
by: Ron Adam | last post by:
I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but it's not always clear which, so I came up with the...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6858
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.