time

Calculate minutes until specific time? (C)

What's the simplest way to calculate the number of minutes until 9pm (being today or tomorrow)? Was looking over mktime() but seemed a hassle to get the day # and month, dealing with all that. ...

Minimizing a function dealing with seconds and minutes.

Can I shorten this function? $mins = $secs - time('u'); function minutes($seconds){ return sprintf( "%2.2dm %2.2ds", floor($seconds/60),$seconds%60);} $mins_left = minutes($mins); echo "Resets in $mins_left."; ...

Help in getting Hour and Minute in PHP

Hi, I need to get the current time, in Hour:Min format can any one help me in this. Thanks in advance Shibin ...

Time into string with HH:MM:SS format (C-programming)

I need to get the current time in a "HH:MM:SS"-format into a character array (string) so I can output the result later simply with a printf("%s", timeString); I'm pretty confused on the timeval and time_t types btw, so any explanation would be awesome:) EDIT: So I tried with strftime etc, and it kinda worked. Here is my code: time_t c...

How to get current localtime using Mysql and PHP?

I read from mysql website, I execute this: SELECT CURTIME() But then how to get the value? Using mysql_fetch_assoc()?? ...

Python: user friendly time format

Python: I need to show file modification times in "1 day ago", "two hours ago", format. Is there something ready to do that? It should be in english ...

Calculating the Difference Between Two Java Date Instances

I'm using Java's java.util.date class in Scala and want to compare a date object and the current time. I know I can calculate the delta by using getTime(): (new java.util.Date()).getTime() - oldDate.getTime() However, this just leaves me with a Long representing milliseconds. Is there any simpler, nicer way to get a time delta? ...

How to store fractions of a second in mysql

Hey, I would like to store time data accurate to the centisecond. The mySQL manual states that all stored values will be rounded. I see two decent options. The time above the decimal place can be stored as TIME, and below the decimal can be stored as a TINYINT. The other option might be to shift all the values up so that HH:MM:SS:cc...

VB.NET - Precise Time

I need access to very precise timing in a .NET application. I need microsecond precision. Is there an easy way to do this in .NET? ...

ms access date and time. Time must be 7:00 AM and user must not edit time.

I have a form where users input information for a test run on a particular date. This creates a table that i then link with another table based on the date and an ID. In this other table (filled by a form created by someone else) all of the times are 7:00 AM. Whoever created the form for that table did what I'm now asking about; since...

How do you say something happened "x minutes ago" or "x hours ago" or "x days ago" in Ruby?

If I have a time variable in Ruby, how could I say that it refers to an event that happened one of the following: "x minutes ago" or "x hours ago" or "x days ago" Obviously if something happened 2 days ago, I would not want to say it happened such-and-such minutes ago. ...

Desktop application validity

I am creating a desktop application using AIR. In that application user is allowed to download some resources which have life span of 2 days. I am storing the date when the user is downloaded. But how can i check whether the date is passed 2 days or not? Right now I am checking with the current system date.But when the user changes the ...

When could a call to time(NULL) fail on Linux

According to this documentation http://www.cplusplus.com/reference/clibrary/ctime/time/ for time(NULL) "If the function could not retrieve the calendar time, it returns a -1 value." Is this something I should check for in my code? Surely something has got to be going pretty wrong if time(NULL) is not retrieving the time. ...

Efficiently handling timed events in a server

In my case I've got a game server, with the CLR threadpool handling the sockets, and a managed threadpool for the other stuff. I'm trying to figure out what the best way to handle events like, an npc casting a spell, or despawning after a set period is. I could just write some sort of Timer wrapper that gets a new (managed)threadpool t...

ASP.NET Application - Time and Cost estimate

Hi, I am building an ASP.NET application. Here I need to provide time and cost estimate for this application to my boss. Would someone guide me how to proceed on this? Please refer few good tutorials /links to carry-out these calculations. Thanks and Regards. Bhavna. ...

php timestamp time function. 2008 is larger number then 2009

I don't get it I want to calculate something I want to check if the time out of the database is before or after this time so I made this. $qVraagCodeOp = "SELECT * FROM `code` WHERE `Code_Code` = '$value'"; $rVraagCodeOp = mysql_query($qVraagCodeOp); $aVraagCodeOp = mysql_fetch_assoc($rVraagCodeOp); $oldTime = mktime($aVraag...

C# - displaying the build date

I currently have an app displaying the build number in its title window. That's well and good except it means nothing to most of the users, who want to know if they have the latest build - they tend to refer to it as "last Thursday's" rather than build 1.0.8.4321. The plan is to put the build date there instead - So "App built on 21/10...

is there a Best Practice or industry standard for the length of "time out" for web pages for Ecommerce businesses with website containing Personal Identity Information?

is there a Best Practice or industry standard for the length of "time out" for web pages for Ecommerce businesses with website containing Personal Identity Information? ...

Add Selected 'Attribute' to Select Box Based on PHP Time

I am currently using the following PHP code generate a Select Box with different times: <? for ($x = 28; $x < 81; $x++) { if ($x == 48) { print "<option selected='selected' value='" . date("H:i:s", mktime(0, $x * 15, 0, 0, 0)) . "'>" . date("g:i a", mktime(0, $x * 15, 0, 0, 0)) . "</option>"; } else { print "<option value...

ASP.NET Application – Making a Time Estimate

Hi, We are building an ASP.NET application. Here I need to make time estimate for the entire application. At present I am using my past experience and some thumb rules to arrive to a rough estimate. So now my doubt is that do people use past experience and few thumb rules to make it or use some common methodologies/practices such a...