hour

Subtract n hours from a DateTime in Ruby

Hello there, I have a Ruby DateTime which gets filled from a form. Additionally I have n hours from the form as well. I'd like to subtract those n hours from the previous DateTime. (To get a time range). DateTime has two methods "-" and "<<" to subtract day and month, but not hour. (API). Any suggestions how I can do that? ...

How do you set the time and only the time in a calendar in Java?

Having the hours and minutes, is there any easier or better way to set it into a Calendar object than: calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), hour, minute); ...

How to do a cron job every 72 minutes

How would I get a cron job to run every 72 minutes? Or some not so pretty number like that? ...

Convert dates to hours

Hello all, I'm trying to work with dates for the first time, I did it something about that with Flash but it's different. I have two different dates and I'd like to see the difference in hours and days with them, I've found too many examples but not what I'm loking for: <?php $now_date = strtotime (date ('Y-m-d H:i:s')); // the cur...

Java Swing GUI hour glass

In my Swing program there is a JTabbedPane, when user clicks on a tab, the program takes a while to get the data and process the results, then shows the results in the selected tab, how can I display a hour glass, or something of that effect so that user knows it's processing data, not to click on the tab again before it finishes it job....

regex hour:minute (hour > 24)

I would like to validate and extract the hours and minutes from a string using Regex in .NET. Just to recuperate the two numbers, separated(or not) by :. Accepted format h:m or m. Unaccepted :m, h:. EDIT: This is to note, that the number of hours could overflow the 23 till... 32. The overflow for hours(over 32) and minutes(over 59) I w...

Sql by hour starting at noon

I'm currently using a select statement with one column as DATEPART(hh, CallTime) AS Hour and then doing: GROUP BY DATEPART(hh, CallTime) ORDER BY Hour This displays the hours starting at midnight and going through midnight - how would I go about having this go from noon to noon? Thanks! ...

Asp.Net Charts Hour wise

Hi, I used cahrt Control in my asp.net application, for all types of are working perfectly, but hour wise charts are displaying very ugly... I am taking the time as on X-Axis and Count on Y-Axis, I want to display the total 24 hours on X-Axis, like 0 1 2 3..... 24 Can any one tell me how to set the property.. how to di...

Problem with Gregorian Calendar hour of day in java

hi, I'm using a Gregorian Calendar to set a specific date and time to an application using the set function of the Gregorian Calendar. When i use the getTime() method, it gives me the right output however when i try to access the Hour_Of_Day and Minute it gives a wrong number. Calendar time = new GregorianCalendar(); time.se...

WPF Edit hours and minutes of a DateTime

Hi ! I have 3 TextBoxes to edit a DateTime. What is important to notice is that those 2 TextBoxes are editing the hour and minutes of the first TextBox DateTime value. One to edit the Date and 2 to edit hour and minutes. How would you do that? The code below doesn't reflect the DateTime changes when editing the hour or minute, because i...

how to get hour minute from NSDate

Hi in my application i need to get the hour and minute seperately, NSString *currentHour=[string1 substringWithRange: NSMakeRange(0,2)]; int currentHourInNumber=[currentHour intValue]; consider string1 contains "11:59:13 AM" which is coming from datepicker. here if i use above code, its okay to get hour if its greaterthan 9. e...

how to set hour minute in nsdate programatically?

hi i am having 2:01:20 PM format in one label, after some calculations , i need to change the hour, minute , of that label that is , is it possible to change that label value,by converting it as NSDate object and can modify hour , minute like 3:20:30 PM is there any setter methods to do it. Thanks in advance. ...

Convert seconds to Hour:Minute:Second

I need to convert seconds to Hour:Minute:Second for example : 685 converted to 00:11:25 can you please help me achieve this thanks ...

Why he return 11 all the time ??? (btw. now is 16 h my local time)

private void hour() { Toast.makeText(this,String.valueOf(Calendar.HOUR_OF_DAY),Toast.LENGTH_LONG).show(); } ...

Problem using JPA with Oracle and grouping by hour

Hi, I have a problem using JPA with Oracle and grouping by hour. Here's the scenario: I have an entiry named EventData. This entity has a java.util.Date field named startOfPeriod. This field maps in a table field of datatype DATE. The query I'm using is something like: select min(ed.startOfPeriod) as eventDate, (...) from Event e inner ...