Questions tagged [hour]

457 questions
-3
votes
1 answer

Iterator between two given hours

I was in a job interview and got this question: " Write a function that gets 2 strings s,t that represents 2 hours ( in format HH: MM: SS ). It's known that s is earlier than t. The function needs to calculate how many hours between the two given…
N.Bar
  • 135
  • 1
  • 1
  • 10
-3
votes
1 answer

PHP worker hours calculation

So I have the program saving work start and end times into a database like so: id worker_id start end 1351 7 2013-06-26 08:00:00 2013-06-26 17:00:00 It saves te times for each day…
-4
votes
2 answers

Java: How to get the time on the hour?

I need to know how to get the the time. I am trying to make it run something at the top of every hour( 1:00, 2:00, 3:00, etc.). If you could help me that would be great!
-4
votes
1 answer

PHP echo only 1 higher or 1 lower then current hour

So I'm having this issue where I want to echo only the things that are 1 higher or 1 lower then the current hour. Example if current hour = 14 only echo 13, 14 and 15 Anyone have a clue on how I can do this?
Kevin Houghton
  • 45
  • 2
  • 10
-5
votes
2 answers

Get data in current date last hour in sql

i want to count the data in current date last hour (for example now() is 2020-04-11 12:30:00 , then i want to get data before 12. any idea ? table_a timestamp 2020-04-11 10:00:00 2020-04-11 10:00:00 2020-04-11 11:00:00 …
hinafaya
  • 111
  • 1
  • 4
  • 16
-5
votes
1 answer

Does dateComponents use 24 hour time? (scheduling local notifications)

This code would create a notification trigger that repeats every day at 10am, right? var dateComponents = DateComponents() dateComponents.hour = 10 dateComponents.minute = 0 let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents,…
RanLearns
  • 4,086
  • 5
  • 44
  • 81
-5
votes
1 answer

How do you Calculate Hours from the Beginning of the Year in PHP

I Was Just Wondering How do you Calculate Hours from the Beginning of the Year in PHP 7.1 It's for a countdown clock that is precise
1 2 3
30
31