Questions tagged [hour]

457 questions
2
votes
4 answers

How to add and subtract hours and minutes

I have some problems. I am a beginner programmer. I need to create an application like a clock with Android Studio and need to add and subtract hours and minutes. When I press the +1H will need to add 1H to take the same with +1M and -1M and I can't…
Riarm
  • 21
  • 1
  • 3
2
votes
1 answer

How to get correct output of hour: "2-digit" for toLocaleString("en-US") with AM/PM?

According to the toLocaleString() MDN Documentation the option hour: "2-digit" should return a 2 digit representation of the hour, but it returns only 1 digit if the locale is en-US and the format is AM/PM. (Update: AM/PM mention) let d = new…
Peter
  • 31
  • 1
  • 3
2
votes
1 answer

Generate list of datetimes with hourly timedelta

I am using this code to generate a range of hourly datetime's: from datetime import datetime, timedelta def daterange(start_date, end_date): # timedelta only has days and seconds attributes for n in range(int ((end_date -…
interwebjill
  • 920
  • 13
  • 38
2
votes
2 answers

Extract monthly data from hourly resoluted netcdf file in nco

As the title indicates, I want to extract a time period e.g january for a variable, wind_speed, from a .nc file that consists of wind speeds with 3-hourly resolution during one year. I would like to do this in nco if possible. I tried the following…
David Halley
  • 417
  • 3
  • 6
  • 18
2
votes
2 answers

How to get hours only from a timespan

How do I use only hours from DateTime.Now.ToString() for setting a value (eg: a price) for two or more intervals? I want to set a variable p differently for every 5 hours.
2
votes
4 answers

How to get the MAX(Hour) and The MIN(Hour) for each day in this query?

I have this structure of table Diary: CREATE TABLE Diary ( [IdDiary] bigint, [IdDay] numeric(18,0) ); INSERT INTO Diary ([IdDiary], [IdDay]) values (51, 1), (52, 2), (53, 5); And this other structure for table DiaryTimetable: CREATE…
Esraa_92
  • 1,558
  • 2
  • 21
  • 48
2
votes
3 answers

How to generate hours between two hours in SQL Server?

I want to generate a list of hours between to hours with an interval of 30 minutes. For example an employee enters work at 09:00 and leaves at 18:00, so I want to generate…
Esraa_92
  • 1,558
  • 2
  • 21
  • 48
2
votes
1 answer

Extracting 2 digit hour from POSIXct in R

I would like to extract the hour from a POSIXct time in R, but retrieve the 2 digit answer. For example, test=as.POSIXct("2015-03-02 03:15:00") test [1] "2015-01-02 03:15:00 GMT" month(testing) [1] 1 hour(testing) [1] 3 The results give the…
sym246
  • 1,836
  • 3
  • 24
  • 50
2
votes
6 answers

How to convert minutes to days, hours, and minutes?

I am a beginner to Python so I do not know a lot of terms or anything really. Can I ask on how to convert minutes to hours and minutes EX: 75 minutes ->0 days, 1 hour, 15 minutes print("Welcome to the Scheduler!") print("What is your name?") name =…
StevenD
  • 17
  • 1
  • 1
  • 4
2
votes
3 answers

JVM Timezone is off by one hour

Using Java 6 update 30 on a Windows XP machine. Updating Java or Windows is not an option. I need a way to change the internal Java clock back one hour to match the system time. The machine is in Russia and Windows system time is correct, but the…
vuribe
  • 23
  • 1
  • 4
2
votes
1 answer

How can I add two date strings in the format HH:MM:SS together?

I am saving the variables in the format of HH:MM:SS. I want to sum up several variables such as: TotalTime += var1+var2 It gives me the result of 0, whats the right format for getting the sum as HH:MM:SS?
user2828251
  • 235
  • 2
  • 7
  • 21
2
votes
1 answer

Count rows per hour in SQL Server, appending zeroes for the time gaps in between

I am trying to count the rows per hour from a table in SQL Server. The result I'm looking for is to have a count for each hour of my data (even though the entries span over different minutes of each hour), essentially aggregating the data. This is a…
2
votes
2 answers

Adding varchar value and datetime in MS SQL

I need some help with a query. I have the following columns: Fulltime (datetime) Hour (varchar) I need to convert the Hour into time format, and add it into the Fulltime For example: Fulltime = 2009-10-10 00:00:00:000 Hour = 10:30 Result =…
Omri
  • 1,436
  • 7
  • 31
  • 61
2
votes
2 answers

Running a cron job every 2:30 on every day?

If I creating cronjob to running for every 2:30 the command will run? (It mean, my cron will running after 90 minutes for every hours.) the command like: 30 */2 * * * /command/xxx => that's right? Please help?
user3770138
  • 51
  • 1
  • 1
  • 4
2
votes
1 answer

Mysql group by hour don't work with week range

I have time range in database: date temp 2014-05-09 20:40:01 19.6875 2014-05-09 20:50:01 19.375 ..................... 2014-05-10 00:10:01 17.5 ........................ 2014-05-23 08:25:01 27.4375 And i want get all AVG…
Dmitriy
  • 23
  • 2