Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get current minutes php

Tags:

php

time

i need a simple script to print the current minutes. but ONLY the minutes(or seconds ^^). in php

like image 732
antoha Avatar asked Dec 27 '10 12:12

antoha


People also ask

How can I get minutes in PHP?

$min = $interval ->days * 24 * 60; $min += $interval ->h * 60; $min += $interval ->i; // Printing the Result in Minutes format.

How can I get current time in hours and minutes in PHP?

print date('H:i'); $var = date('H:i'); Should do it, for the current time. Use a lower case h for 12 hour clock instead of 24 hour. More date time formats listed here.

What does time () do in PHP?

Definition and Usage The time() function returns the current time in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).

How can I get different time in PHP?

Use date_diff() Function to Get Time Difference in Minutes in PHP. We will use the built-in function date_diff() to get time difference in minutes. For this, we need a start date and an end date. We will calculate their time difference in minutes using the date_diff() function.


1 Answers

use date('i') to show minutes or date('s') for seconds. http://php.net/manual/en/function.date.php

like image 142
erinus Avatar answered Sep 27 '22 23:09

erinus