time

Ensure User has entered string in correct format?

Hi, Whats the best way to ensure the user has entered a valid time string such as: 5:24 5.4 102:30 102.5 It will be entered into a UITextField therefore will be in a NSString. I want to allow the user to enter the time in either hours and minutes (hh:mm) or hours and decimal minutes (hh.m). In the hours minutes example they should ...

MS Access query for time

Following data and using MS Access with VB6 UserID UserName LogTime LogDate 1 S 9:00 21/5/2010 1 S 10:00 21/5/2010 1 S 11:00 21/5/2010 1 S 12:00 21/5/2010 1 S 14:00 21/5/2010 1 S 17:00 21/5/2010 Need Output as in below 6 co...

How can I profile a subroutine without using modules?

I'm tempted to relabel this question 'Look at this brick. What type of house does it belong to?' Here's the situation: I've effectively been asked to profile some subroutines having access to neither profilers (even Devel::DProf) nor Time::HiRes. The purpose of this exercise is to 'locate' bottlenecks. At the moment, I'm sprinkling pri...

Why did my ASP.NET Web App stop showing AM in times?

I haven't made any code or configuration changes (that I know of) to my ASP.NET web application and this morning it suddenly stopped showing the AM in my displayed times. PM still shows up, just not AM. It's hosted on Windows Server 2003. I figured somehow the OS regional settings might have been changed somehow, but that doesn't appear ...

Insert text depending on time of day and day of week.

I'm trying to piece together a php script to output different text depending on what day it is and the time of day. Example: On weekdays (mon-fri), I would like to output text according to the following periods of time (24H, server time, UTC): 00:00-08:00: "Lorem ipsum" 08:00-13:00: "dolor sit amet" 13:00-15:00: "Pellentesque habitant" ...

heroku time zone problem, logging local server time

UPDATE: Ok, I didn't formulate a good Q to be answered. I still struggle with heroku being on -07:00 UTC and I at +02:200 UTC. Q: How do I get the log written in the correct Time.zone ? The 9 hours difference, heroku (us west) - norway, is distracting to work with. I get this in my production.log (using heroku logs): Processing Pro...

Python: Figure out local timezone

I want to compare UTC timestamps from a log file with local timestamps. When creating the local datetime object, I use something like: >>> local_time=datetime.datetime(2010, 4, 27, 12, 0, 0, 0, tzinfo=pytz.timezone('Israel')) I want to find an automatic tool that would replace thetzinfo=pytz.timezone(...

quartz hardware clock

Hi I am using quartz in my project and have one cron job. The cron expression I give the trigger (CronTrigger) as the running parameter is alighnt with the pc's hardware clock. Any ideas how to tell the job to look at the software clock instead ? For instance I have a Job running for a year , and the it runs exactly at 10pm, and someda...

jQuery, how do I check a time range?

Hi all, I want to display 3 different background images according to the time of the day: one for morning from 4am to 12am one for afternoon from 12am to 6pm and one for the night from 6pm to 4pm. Im using the json server to get the time zone etc... I tried this but doesn't work properly: $(document).ready(function(){ var timezon...

Automatically update or delete record(s) after x time in coldfusion

Hi, I've searched all over the net for this. Hope that someone's got something. How would a record in a database be updated automatically after x time n coldfusion? I know how to manually do it by writing an sql that performs an action to all records older than x time based on the timestamp. How would this be done automatically? Kind...

Parsing String to Time makes 01:00:00

When I do the following: String start = request.getParameter("startp"); SimpleDateFormat sdf = new SimpleDateFormat("hh:mm:ss"); long ms=0; try { ms = sdf.parse(start).getTime(); } catch (ParseException e1) { e1.printStackTrace(); } Time ts = new Time(ms); it is inserted with this value 01:00:00 witch is not the correct one ...

Getting the System tick count with basic C++?

I essentially want to reconstruct the getTickCount() windows function so I can use it in basic C++ without any non standard libraries or even the STL. (So it complies with the libraries supplied with the Android NDK) I have looked at clock() localtime time But I'm still unsure whether it is possible to replicate the get...

Covert time format in php

How would I covert a date formatted like this Thu, 08 Jul 2010 15:51:01 into a date like this Thursday July 8th, 2010 3:51 pm. Also, how would I filter the first sting to not include time, so that it could look like this in the end Thursday July 8th, 2010 ...

Convert Unix Epoch Time to format HH:MM:SS without the date

I'm using SSRS 2005 and I need to convert time from a serial unix time like 3412.254263 to a duration like 166:12:35 where the second format is HH:MM:SS. All .NET code should work, but I can't find any function that does not include the date or does not treat the result as a duration. Any help would be appreciated! ...

Convert Unix Epoch Time to Seconds in SQL or .NET

First let me thank you all for your help. What I need is a function that takes in a EPOCH time stamp, like 1452.235687 and converts it to a readable timestamp like '01-01-1970 00:00:00'. More specifically I only need the time not the date. If at all possible I would prefer a .NET function instead of a SQL stored procedure. However an S...

how to convert minutes to days,hours,minutes

hi how to convert minutes into days hours and minutes in java ( we have a week here , 7 days ) public String timeConvert(int time){ String t = ""; int h = 00; int m = 00; // h= (int) (time / 60); // m = (int) (time % 60); // if(h>=24) h=00; if((time>=0) && (time<=24*60)){ h= (int) (time / 60); m = (in...

Haskell Convert Byte String To UTC Time

I have been trying to make a function in Haskell to take a ByteString which is a datetime and convert it to UTC time taking into account the time zone from the original encoding. I am very new to Haskell so I may be making a really basic mistake. convertStringToUtc s = do estTimeZone <- hoursToTimeZone -5 time <- read $ B.unpa...

boost timer usage question

I have a really simple question, yet I can't find an answer for it. I guess I am missing something in the usage of the boost timer.hpp. Here is my code, that unfortunately gives me an error message: #include <boost/timer.hpp> int main() { boost::timer t; } And the error messages are as follows: /usr/include/boost/timer.hpp: In m...

Python multiprocessing doesn't play nicely with uuid.uuid4().

I'm trying to generate a uuid for a filename, and I'm also using the multiprocessing module. Unpleasantly, all of my uuids end up exactly the same. Here is a small example: import multiprocessing import uuid def get_uuid( a ): ## Doesn't help to cycle through a bunch. #for i in xrange(10): uuid.uuid4() ## Doesn't help to...

Date from String using NSDateFormatter regardless 12h-24h setting

Hello everybody, Today my question is about date formats and strings. My application downloads some strings representing dates from the internet. The date format is always like this: "2010-05-24 at 20:45" I need to convert this string into an NSDate object in order to perform some date manipulations. I tried this code: NSString * dateSt...