Browsing Questions About time (1)
How can I determine a web user's time zone?
Is there a standard way for a web server to determine what time zone offset a user is in?
From an HTTP header or part of the user-agent description, perhaps?
Help with CRON jobs?
How can i set up my crontab to execute X script at 11:59PM every day without emailing me or creating any logs?
Right now my crontab looks something like this
@daily /path/to/script.sh
Design debate: what are good ways to store and manipulate versioned objects?
I am intentionally leaving this quite vague at first. I'm looking for discussion and what issues are important more than I'm looking for hard answers.
I'm in the middle of designing an app that does something like portfolio management. The design I have so far is
Problem: a problem that ne…
Dealing with PHP server and MySQL server in different time zones
For those of us who use standard shared hosting packages, such as GoDaddy or Network Solutions, how do you handle datetime conversions when your hosting server (PHP) and MySQL server are in different time zones?
Also, does anybody have some best practice advice for determining what time zone a …
How to display "12 minutes ago" etc in a PHP webpage?
Can anyone tell me how I can display a status message like "12 seconds ago" or "5 minutes ago" etc in a web page?
If I have a PHP string in the format YYYY-DD-MM and a timestamp in MySQL, is there a good way to convert between them?
I'm interested in doing comparisons between the date string and the MySQL timestamp. However, I'm not seeing an easy conversion. Am I overlooking something obvious?
“rusage” statistics
I'm trying to use “rusage” statistics in my program to get data similar to that of the time tool. However, I'm pretty sure that I'm doing something wrong. The values seem about right but can be a bit weird at times. I didn't find good resources online. Does somebody know how to do it better?
So…
What is the most efficient way to populate a time (or time range)?
While plenty of solutions exist for entering dates (such as calendars, drop-down menus, etc.), it doesn't seem like there are too many "standard" ways to ask for a time (or time range).
I've personally tried drop-down menus for the hour, minute, and second fields (and sometimes an "AM/PM" field…
What should we do to prepare for 2038?
I would like to think that some of the software I'm writing today will be used in 30 years. But I am also aware that a lot of it is based upon the UNIX tradition of exposing time as the number of seconds since 1970.
#include <stdio.h>
#include <time.h>
#include <limits.h>
void print(time_t rt)…
Datetime arithmetic with a string in Ruby
In Ruby, I'm trying to do the following.
def self.stats(since)
return Events.find(:all, :select => 'count(*) as this_count', :conditions => ['Date(event_date) >= ?', (Time.now - since)]).first.this_count
end
where "since" is a string representing an amount of time ('1 hour', '1 day', '3 da…
What is the simplest way to find the difference between 2 times in python?
I have 2 time values which have the type datetime.time. I want to find their difference. The obvious thing to do is t1 - t2, but this doesn't work. It works for objects of type datetime.datetime but not for datetime.time. So what is the best way to do this?
How to parse relative time?
This question is the other side of the question asking, " How do I calculate relative time? ".
Given some human input for a relative time, how can you parse it? By default you would offset from DateTime.Now(), but could optionally offset from another DateTime.
(Prefer answers in C#)
Examp…
Resetting detection of source file changes
I sometimes have to work on code that involves me moving my clock ahead forward. In this case some .cpp or .h files get their last modification date updated to the future time as I work on them.
Later when my clock is fixed, and I go to compile, it requires a rebuild of most of the project beca…
How do you measure the time a function takes to execute?
How can you measure the amount of time a function will take to execute?
This is a relatively short function and the execution time would probably be in the millisecond range.
This particular question relates to an embedded system, programmed in C or C++.
How can you insure your code runs with no variability in execution time due to cache?
In an embedded application (written in C, on a 32-bit processor) with hard real-time constraints, the execution time of critical code (specially interrupts) needs to be constant.
How do you insure that time variability is not introduced in the execution of the code, specifically due to the proc…
Next Page >