Converting Time To 'days, Hours:minutes'
I'm trying to 'age' files but can't seem to figure it out.
I'm getting the files modified value and doing:
> time() - $mtime;
to get back something like:
> 18699668
How do I convert this value to 'xdays, yhours:zminutes'?
View Complete Forum Thread with Replies
Related Forum Messages:
Find The Days, Hours, Minutes And Seconds?
I am making a function the will determine the amout of days, hours, minutes and seconds that are in a certian amout of seconds. For example: $all_seconds = 11405; I want to have this returned: $days = 0; $hours = 3; $min = 10; $sec = 5;
View Replies !
Time In Hours-Minutes-Seconds (accumulated)
Time in Hours-Minutes-Seconds (accumulated) How do I do this? I have minutes: $minutes_online = intval((time() - strtotime($data[$i]['dLastLogon']))/60); Ex: $minutes_online = 8758; How do I show this in Hour:Minute:Second - 10:32:22
View Replies !
Find Difference In Hours- Edit Code From Days To Hours?
I'm trying to find the difference in hours between one date from another, and my code currently finds the difference in days- could somebody edit the code to use hours instead of days? $expirationdate[0] = $row3[datetillcompletion]; $startdate[0] = date('Y-m-d'); $startdate = strtotime($startdate[0]); $expirationdate = strtotime($expirationdate[0]); $delta = $expirationdate - $startdate; $final=round($delta/86400);
View Replies !
Working With Dates In Hours Minutes Seconds ?
I have 2 dates in this format $timeold = date('m.d.y H:i:s', $timeold); $time2=(strtotime("now")); $time2 = date('m.d.y H:i:s', $time2); for example $timeold is 09.21.06 08:50:30 and $time2 is 09.21.06 09:00:38 When I make this $diff= $time2-$timeold; I receive this -608.21000003815 how can I transform this value (-608.21000003815) in hours minutes seconds ?
View Replies !
Hours To Man Days
I know this is prob easy but i've looked around and can't find what i am looking for, plus i'm a little bit of a newb. I have a group of total hours for a bunch of workers,, i.e each is like 280 hrs and i need to display these set of hours in another way, i need to display them in total man days instead and a man day for me is 6.5 hours now i know i can just divide 280 by 6.5 in php but that gives me something like: 43.076923076923076923076923076923 i need it to output in a format something like 43 days + 1 hour (or minutes if less than an hour)
View Replies !
Converting Date To Minutes
I have $x="200504161035" that is 10:35 on 16 April 2005. My questuion: what is the *shortest* piece of code to convert that variable to minutes? I have a feeling there is a PHP function that should be able to do it but I cannot find it. The long way takes 5 lines of code.
View Replies !
Converting Timestamp Into Minutes And Seconds
I am timing employees who take a test. I have the start time and end time, which are unix epochs, and subtracing the start from the end will give me a large number of seconds, for example 552. I want to convert this into minutes and seconds.
View Replies !
Convert UNIX Format Into An Hours:Minutes:Seconds Format
I have a a UNIX format number that I want to convert into an Hours:Minutes:Seconds format for a stopwatch/countdown timer script I'm writing. I used date("H:i:s", ($time)), but the problem is, if the period I'm counting is above 24 hours, the Hours reset to 0. So If I was counting down 49 Hours, It's be displayed as 01:00:00 instead of 49:00:00.
View Replies !
Time + 10 Minutes
$ganja=date("D dS M h:i A"); Assuming the above produced the following . Tue 02nd Jan 11:55 PM How do i add 10 minutes to it to produce this ? . Wed 03rd Jan 00:05 AM
View Replies !
How Many Minutes Have Passed From A Given Time
i egt php to tell me in minutes how many minutes have passed from a given time for example i have a form that a user enters 2 times 1 when he took off and one where he landed i need php to work out how many minutes have elapsed from the take off time. currently i am useding the timespan command but i can get it to work out in minutes correctly i think. PHP Code: $timespan =($landingtime + $takeofftime);
View Replies !
Time Is Off By 2 Hours?
Whenever I create a new php file and use the date function like so <?php echo date("g:i"); ?> My browser outputs the correct time (I believe i am GMT-5:00) the first few times the file is opened, then the time becomes slow by 3 hours every time it loads (ex: 7:00pm my time shows up as 4:00pm on the browser screen). Is there a simple way to add 3 hours in the date function?
View Replies !
Adding Hours To Time
Whats the most effective way of adding 3 hours to a time in the format of 1:30 (h:mm), and turning it into a 24 hour format? I was thinking of turning it into a timestamp and working from there, but it seems a bit inefficient.
View Replies !
Adding 5 Hours To A Time Using PHP?
I would like to take a date of this format: DATE("Y-m-d H:i:s") and add 5 hours to it. Is there an easy way it can be done? I was thinking about just changing the string, but there's too much to acount for (leap years, etc).
View Replies !
Server Time +8 Hours
I'm inputting a DATETIME timestamp of $now into my table <? $now = date("Y-m-d H:i:s"); ?> - which enters the exact time of update into the table. The problem is, is that I'm in Dublin (GMT) and the hosting server is in the US 7 hours behind. so if I entered data at exactly midday in dublin, the value displayed is 5am. Can someone guide me as to how I can alter the variable [b]$now[/b] to show Dublin time?
View Replies !
Expiry Time In Working Hours
Im writing a small application to time software projects. When a developer logs a query, they have to specify the estimated time it will take in working hours. I would like to state the estimated closing time, taking into account that the business works 09:00 - 17:00 Mon-Fri Code:
View Replies !
Expiry Time Expressed In Working Hours
Im writing a small application to time software projects. When a developer logs a query, they have to specify the estimated time it will take in working hours. I would like to state the estimated closing time, taking into account that the business works 09:00 - 17:00 Mon-Fri Example 1 Query logged at 15:00 on 23/01/2006 Estimated time = 3:00 Estimated completion time 10:00 on 24/01/2006 Example 2 Query logged at 09:00 on friday 27/01/2006 Estimated time = 12:00 Estimated completion time 12:00 on Monday 30/01/2006
View Replies !
Check Date And Time And Display A Link Between Certain Hours
I need to write a PHP script that can check the date and time, and if it falls in between certain hours to display a link, and if not display another link. The application is for a realaudio broadcast which goes live 7-9pm every wednesday. If it's not "live" then the link would be to the archive from the previous show.
View Replies !
Difference In Hours Between Server Time (London) And User's Location
I've spent hours going round in circles with this and really dont get it. I'd like some code which simply works out how many hours ahead/behind a users local time is to the time of the server (in London). It needs to take into account summer time +1 hrs etc. e.g. the code works out that a user is in Paris (or France) and then works out that they are +1 hr ahead of uk time. This would allow me to add an hour to times stored in databases when they are showed to the users, as the site is an international networking site.
View Replies !
How To Get Time In 5 Days, 4 Hrs, 45 Min Format
Here is the code : $currentdate = time(); // current time $expirydate = time() + (5 * 24 * 60 * 60); //Add 5 days to the cuurent date now i want to display an item w.r.t current time. if current time is less than the expiry time stored in database current date then item will be shown and end date of that item will b displayed in follwing format : e.g; 4 days, 8 hours, 45 Mins // output
View Replies !
Converting To Time
I am facing problem in converting to time. select sec_to_time(unix_timestamp(now())-unix_timestamp(timestamp)) from Tablename where name= '".$name."'"; Here when values exceeds 838:59:59 how to get the exact value of time. Other than sec_to_time() is there any other function which gives the exact value
View Replies !
Converting Time
I have an application that gives me numbers like 1183354915 and the php coding converts it into a time. print date('d m Y', $row['topic_time']); Are there any converters that will allow me to input July 2, 10:59PM and it will spit out that number?
View Replies !
Converting Integers Into Time
Say you had a number 34. Now i want to convert that to time by making it become 3 hours and 40 minutes.. in a time stamp manner.. On top of that say the number rolled above a 6 (suggesting 60 minutes) itll roll on to the next time line like: 364 becomes(36 - the 6 rolls over to the 3 so 3+1 = 4) which makes 44 is 4 hours and 4 minutes. then this would become 4 hours and 40 minutes as the hundred mark infact adds onto hour... How is this done and also put into a time stamp?
View Replies !
Converting UTC To Local Time
My PHP connects with a postgresql database and fetches the last login information of type "timestamp with time zone". The database returns this value: 2007-08-06 19:05:14.551719-06, but the actual time I have right now is 9:05:14 PM. I assume the time given by the database is in UTC. Now, how do I convert this to respect the local time of the user seeing this? For example, I am located in eastern time zone and I should be seeing 9:07:14 PM, but someone in central time zone should be seeing 8:05:14 PM. Is there a PHP code that can convert this time into the local time of the current user viewing the time depending on his geographical location?
View Replies !
Sort Results By Date/time, Limit 5 Database Entries Of Today &/or Upcoming Days
I'm designing a website for my fraternity and in the database I have entries which contain past events, todays events, and upcoming events. My problem is that I can not figure out how to sort the query results to display: 1) only past events based on the CURRENT DATE 2) only the events which fall on the CURRENT DATE or after, limiting the results to 5 entries 3) all events that fall on CURRENT DATE or afterwards Example: Today is September 15, 2007 Problem 1) Displaying all events that happened before September 15, 2007 Problem 2) Displaying only 5 results that fall on September 15, 2007 or after Problem 3) Displaying all events that are happening on or after September 15, 2007 And obviously I would like the CURRENT DATE to change depending on what date it is, currently. Ok so now I've been very redundant in my explanation of my problem here is the code and a link to what that particular page looks like. Code:
View Replies !
Converting Time Stamp To 'normal' Date Function
I'm looking for a bit of code/formulae to convert unix time stamp info into a conventional date format. I have a file that generates invoices from data requested from an sql table - trouble is it brings in the date as a timestamp. I'm looking for something I can plug into the php invoice file rather than altering the database.
View Replies !
Dates 23.00 Hours To 0.00 Hours.
I have the following code $day1 = mktime (0,0,0,1,1,$year); $days = ($week - 1) * 7; $d = strtotime ("+$days days", $day1); $dow = date('w', $d); $sunday = strtotime ("-$dow days", $d); $saturday = strtotime ("+6 days", $sunday); to give me the timestamp on sunday and saturday for a given week and year. The problem I have is that it's giving it at 23.00 hours when i need it at 0.00 hours. 1179010800 translates to Saturday, May 12th 2007, 23:00:00 (GMT) Can anyone see the problem?
View Replies !
How Many Minutes
im trying to work out how many minutes have past and how many remain since the last datetime stamp... does anyone know of any pre-existing functions for this before I reivent the wheel?
View Replies !
Run A Php Script Every 5-10 Minutes?
I have done with a script which will parse a website's xml format file and save(create own file name) that data into my server.... So, now i want to do a script that will run every 10 to 20 minutes that will run/execute my parser program becuase that website which provide me that xml data will update constantly. I have ask one off my friend and he tell me that i can run that php script with CORN and Telnet,and i have try it but cannot.
View Replies !
Run A Script Every X Minutes
Computer 1 sends every 10 minutes a file to Computer 2. This Computer 2 is actually a web hosting service and i don't have a full control. I want to run a script on this Comp2, that will check every 30 minutes, if the file exist and its timestamp is no older than 30 minutes. If it's older, then sends me a notification email (in case if Computer 1 freezes). All ok, but how can i run the script every X minutes?
View Replies !
Seconds To Minutes Conversion
I have a form where a user enters a value that will always be a number which represents minutes. I have the column that receives these values in the mysql table set to time format. the problem that I'm having is when I send the value form the form to the mysql table the number is treated as seconds. how do I change it so that the value is treated as minutes and not seconds.
View Replies !
|