Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
i have time in a format of an integer example:(454 seconds) and i need to convert it to a time format example:(00:07:34) any function can help me to do this??
You can do it using Zend_Date:
$time = new Zend_Date();
$time->setTime('00:00:00');
$time->addSecond(454);
echo $time->toString('HH:mm:ss'); // result 00:07:34
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
How can I convert integer to time in minutes e.g. 5 would give 30mins. I've tried
<?php
$toMin = 5;
echo date('i', ($toMin*60)).'mins';
?>
But it only returns 05mins
so something like:
$time='7.5'; //, 8.3, 2.2.
$x=explode('.',$time);
$min=60*($x[1]/10);
echo $x[0] .'hours and '.$min.'mins';
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a application in which I have to display time and Date in which month has to be in String format. Can anyone tell me any working example because I tried to find on google but could not find out much. Thanks
You should really try reading the manual:
{{ post.published_at|date("m/d/Y") }}
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Please help me to find the current date in the following formate yyyy-mm-ddThh:mm:ss:ss.sssz
<?php
$t = microtime(true);
$micro = sprintf("%03d",($t - floor($t)) * 1000);
$utc = gmdate('Y-m-d\TH:i:s.', $t).$micro.'Z';
echo $utc;
?>
DEMO
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
i want to add 30 days from the date $first and the result in $sec to take the data between these days from MySQL
$first=05/02/2014
result as in
$sec= 06/02/2014 in m/d/y format
thank you
try
echo $sec=date('m/d/y',strtotime('+30 days', time($first))); //06/04/14
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I tried to get events from google calendar. So I have trouble in time output.
$date = DateTime::createFromFormat("Y-m-d\TH:m:sP", "2013-02-12T21:00:00-05:00");
echo $date->format('H:m');
Output is 21:12, but it should be 21:00. How it can be fixed?
m is months. You're looking for minutes which is i:
$date = DateTime::createFromFormat("Y-m-d\TH:i:sP", "2013-02-12T21:00:00-05:00");
echo $date->format('H:i');