time

Apache Django Ajax time or size limit

My ajax responses seem to die out now that I am sending so much data in response to a search form request. I'm using Django with Apache and Firefox and Chrome noth die out if I don't limit my search to few enough results. What's the time or size limit to an Ajax response? ...

Simple way to handle time in C#?

My current approach is something like DateTime startHour = new DateTime(1900,1,1,12,25,43); DateTime endHour = new DateTime(1900,1,1,13,45,32); // I need to, say, know if a complete DateTime instance // is later than startHour plus 15 minutes DateTime now = DateTime.Now(); startHour = startHour.addMinutes(15); if (now.CompareTo(new...

How do I get elapsed time in milliseconds in Ruby?

If I have a Time object got from : Time.now and later I instantiate another object with that same line, how can I see how many milliseconds have passed? The second object may be created that same minute, over the next minutes or even hours. ...

Get year from boost ptime

Hi, This is my first post on stackoverflow. First of all I'd like to say thanks for this site! It has provided many excellent answers to questions I've had in the past few months. I'm still learning C++, coming from vb6. I'm converting an existing program to C++ and here need to manipulate Sybase timestamps. These timestamps contain dat...

Weird time inconsistencies between production and development

For some reason times are appearing differently in development (my local Mac) and production (Heroku). Take a look: (Just prior to doing this I did a heroku db:pull, so the databases should be identical) Production (Heroku) >> Annotation.last.id => 2028 >> Annotation.last.created_at => Sat, 12 Sep 2009 06:51:33 UTC +00:00 >> Time.zone ...

Limit download count with text file in PHP

if ($_SERVER['REQUEST_METHOD']=='GET' && $_GET['download']==='1') { $handle = fopen('lastdownload.txt','rw'); $date = @fread($handle,filesize('lastdownload.txt')); if (time() - 30 * 60 > $date) { fwrite($handle,time()); header('Content-type: application/zip'); header('Content-Disposition: attachment; filename="dwnld_'.date('d_m_Y...

Localize current time in PHP

Trying to display current time with PHP (using this): $date = date('m/d/Y h:i:s a', time()); echo $date; As simple as it gets. How do I localize it? I want to translate the months and days to Hebrew. Thanks. ...

Need to clear the time from date picker string

hi all, I need to cut off the time from the datepicker data. when i try to set the date as a label, the time is also appending to it. is there any way to cut off the time part from the picker data string. please help. Thanks in advance. ...

PHP, alternating weeks logic

I need to write some code in PHP that performs an action only on alternating weeks, based on the day of the week (mon, tue etc) rather than the number (1st, 7th etc). So on a cycle starting on a Monday it should run for one week then not the following week. I am sure this must be easier than I think but can't seem to work it out, so h...

How do you set system time using C/C++?

I have an embedded system (ARM 9263) running an RTOS, IAR tools. The system supports the standard time() function which gives me the current time. I need the reverse call, that is I need to set the time - is there a "C" standard way to do this? I've googled around, sure thought it would be obvious, but perhaps it is platform dependent? I...

Working with time in the iPhone

I have two arrays with time values in them in this format. 00:00:00 which is minutes:seconds:miliseconds. Can someone show me any easy way of adding an subtracting these values? I know I can if I break them down but I am looking for a way to do it without of code. I can get the last values which is what I want to work with like this ...

What is a good ratio of refactoring time versus development time?

Hello, I'm trying to build a plan on how we could spend more time refactoring. So I wanted to compare with the industry standards but I have hard time to find studies or metrics on that. I feel that 20% of dev time spent on refactoring seems a good ratio, but I don't have anything to show for it. In my mind, for 100% or dev time: 50%...

How can I use the Chronic natural language date/time parser to parse "12:00" as 12:00 PM?

I am using the ruby gem "Chronic" to parse four digit strings as DateTime objects. I am using time in military format (ie: "0800") which seems from the documentaion to be a valid format. In most cases, Chronic parses time in this format correctly - however it always parses a four digit string beginning with "12" as 00:XX AM of the ne...

How can I get the real time in iPhone, not the time set by user in Settings?

Hi, I need to ensure that my app gets the correct time, not the time set by the user in settings. So for instance, once the user starts the app, I'd want to get a timestamp. The user would see the elapsed time on a timer on screen updated every second. When the user exits the app, and after some time restarts the app , the timer wou...

Time stamp in the C programming language

How do I stamp two times t1 and t2 and get the difference in milliseconds in C? ...

Writing a function to display current day using time_t?

Hi there, I've been writing a time converter to take the systems time_t and convert it into human readable date/time. Oh, and this is my second python script ever. We'll leave that fact aside and move on. The full script is hosted here. Writing converters for the year and month were fairly easy, but I've hit a serious brick wall tryin...

Server-Side Code to Execute Based on a Time Range

We have a Try/Catch block of code in our web application to trap a certain exception. What we want to do with this exception depends on the current time. If it is between 4:30PM and 3:00AM we will want to send an email, otherwise we will throw the exception. What is the best way to accomplish this? Try 'Yada Catch ex as WebExcept...

Change Alpha on Main Window - Cocoa

Hey guys, I want to know if I can slowly increase the alpha MainWindow when I open the app and when I close the app. I know it may involve timers, and things like that, but I never dealt with this kind of thing before. I need your help guys...! Kevin ...

Auto increase php numbers on different lines 0100, 0200 etc.

Right now im running something based on time and including files. This is a long file and seems unnecessary. What I want to do is auto increment the times for the 24 times i call code. current style coding: if($time >= "0000" && $time < "0100") { include("1.php"); } elseif($time >= "0200" && $time < "0300") { include("2.php"); Is th...

Timing a Curl Operation in Bash

I would like to time how long it takes to submit a batch of files to an HTTP server running on localhost using Curl and write that to a file. I am having trouble getting the syntax correct. export TIMEFORMAT="%R" time -ao times.dat ( curl -v -d @1.batch -X POST $DB ) How can I accomplish this? I imagine it's just a matter of using the...