• Status: Solved
• Priority: Medium
• Security: Public
• Views: 283

# Current time and date + 10 minutes

Hi all,

The following contains the current time and date separated in minutes, hour, day, month and year:

\$minutes = date(i);
\$hour = date(G);
\$day = date(j);
\$month = date(n);
\$year = date (Y);

I need exactly the same plus 10 minutes (the current time and date but 10 minutes ahead).
How can I do that?
0
• 4
• 3
1 Solution

Commented:
Hi,

Use this:

\$entry_date = time();

\$display_date = date("m/d/y H:i:s", strtotime(\$entry_date)+strtotime("10 minutes"));
0

Author Commented:
Thanks shobinsun, it's what I was looking for .. but how can I get the \$display_date broke down into minute, hour, day, month and year?
Thanks once again!
0

Commented:
Hi,

This doing what you want:

date("m/d/y H:i:s", strtotime(\$entry_date)+strtotime("10 minutes"));

or use :

date("M/d/Y H:i:s", strtotime(\$entry_date)+strtotime("10 minutes"));
0

Commented:
hi,

use

date("M D Y H:i:s", strtotime(\$entry_date)+strtotime("10 minutes"));
0

Author Commented:
Sorry, I don't get it, I'm too new to php :(

What I need is the time and date 10 minutes ahead separated in five variables, one for minutes, one for hour, one for day, one for month and one for year ..

Please pardon my "newbiness" :)
0

Commented:
Hi use this:

\$display_date1 = date("M", strtotime(\$entry_date)+strtotime("10 minutes"));
\$display_date2 = date("D", strtotime(\$entry_date)+strtotime("10 minutes"));
\$display_date3 = date("Y", strtotime(\$entry_date)+strtotime("10 minutes"));
\$display_date4 = date("H", strtotime(\$entry_date)+strtotime("10 minutes"));
\$display_date5 = date("i", strtotime(\$entry_date)+strtotime("10 minutes"));
\$display_date6 = date("s", strtotime(\$entry_date)+strtotime("10 minutes"));
0

Author Commented:
thanks!!!
0

## Featured Post

• 4
• 3
Tackle projects and never again get stuck behind a technical roadblock.