Questions tagged [time]

Measuring the time it takes to perform an operation. Also, questions related to obtaining the current time, calculating on times, formatting and parsing times, etc.

0
votes
1answer
17 views

gettimeofday() does not fill its timeval argument

I'm testing if I could use gettimeofday() to measure the performance of a piece of code. #include <unistd.h> #include <stdio.h> #include <sys/time.h> int main() { struct timeval *...
0
votes
0answers
13 views

How to predict value in every 120 minutes using LSTM in python [on hold]

I want to predict value in every 120 minutes continuous using LSTM model. Here I wrote the code for predction. But I'm not getting proper prediction values . Here from start time I need to predict ...
0
votes
3answers
19 views

Using time.time() in while loop causes function to be called twice

I created a function like this: import time def func(seconds): time.sleep(seconds) print(f'waited {seconds} seconds') Now if I create a while loop like this and call func(6), after 6 ...
0
votes
1answer
28 views

java.text.ParseException: Unparseable date: “20:01:00.000Z”

I am getting a value for my time field in this format "10:30:00.000Z". I want to convert it to 10:30 AM/PM format. I'm trying to make use of SimpleDateFormat and parse it but I'm getting java.text....
0
votes
0answers
6 views

Spring boot Thymeleaf input for LocalDateTime

Is it possible to create input for LocalDateTime? I want input with date and time I tried this one <input type="datetime-local" th:field="*{start}" placeholder="Start" ...
0
votes
1answer
26 views

Javascript tree time-line

I have a tree where the first level of it, represents some consecutive time intervals, and level 2 of it represents time-intervals within the parent time-interval and so on. I tried using d3's treemap ...
0
votes
2answers
17 views

Convert decimal time to minutes in SAS

I am having trouble converting a 9.3 decimal variable to minutes. The variable is showing as a fraction of an hour and I need that to show as minutes. Here is an example below of what needs to be ...
-5
votes
1answer
28 views

Rounding time in PHP after decimal [on hold]

$time_taken = 286; $time_taken = $time_taken / 60; //Converting to minutes echo $time_taken; Result: 4.7666666666667 But I need: (expectation:) Result: 5.17 (Expected) I tried: round($...
-1
votes
2answers
28 views

How can I create a countdown timer in an app that persists if the app is closed?

I am creating a game which uses "Energy points" as a currency to do certain actions in the game (you have to spend energy points to do certain tasks). When the player reaches zero energy points, or ...
0
votes
2answers
48 views

Selecting rows that are within 2 hours from current time

I am using PHP with MySQL and would like to select rows that have a booking time within 2 hours from now. How do I compare what is in my database with the NOW() MySQL function? I have columns ...
-1
votes
2answers
43 views

How to select data by the hour

I've been trying to split the data in 30 minute intervals, and I have not been able to find a solution to this problem, the date and time is a date_time variable. I just want to be able to make a df ...
0
votes
1answer
54 views

CalculateTotalHours between two days exclude dates and time ranges [on hold]

Edited: How do I calculate the total hours between two dates (include hours on Monday after 8am but exclude hours on Friday after 5pm)? and exclude holidays and weekends (which i already have logic ...
0
votes
0answers
19 views

Reconcile the Julian day number with day of the week

I am working with a time system that stores dates as Julian day numbers. The problem is that since the Julian day begins at noon, then each Gregorian day is associated with two different Julian days. ...
1
vote
4answers
32 views

How to convert a time to user local timezone in javascript

I am getting this "2019-05-05T10:30:00Z" type of time from an API. But I need to convert it like this "10:30 AM (3:30 PM Your Time)". I am using reactJs for my client side. How can I convert the time ...
0
votes
0answers
10 views

To check: Overlapping of two RRULEs with different parameters and timeslot

I have to create an algorithm in which I will be provided with two different RRULEs with different frequency, interval, count and start. Also, the respective timeslots will be provided for these ...
0
votes
0answers
33 views

Tournament problems

We had this little assignment to create tournaments of n teams, that have to play m games each on o courts with 3 rules: A game must not be played more than once A team cannot play against itself The ...
1
vote
3answers
67 views

How to declare a std::chrono::duration<double> variable in c++

I am working on a code where I am calculating the duration of time and then saving it in list. auto start_time = std::chrono::high_resolution_clock::now(); /* *some code here */ auto finish_time = ...
-1
votes
2answers
22 views

Finding what month it is based on the number of the week in a year

I'm using moment.js to store daily/weekly/monthly data. Every day a function executes and collects all the logs from that day and stores them into a weekly node with moments .isoWeek() method to ...
2
votes
3answers
70 views

How to save chrono time in list in C++

I am working on c++ code where I am trying to save chrono time in a list so that I can read the value later on and can calculate the time duration. The reason of saving the time in list is because I ...
0
votes
1answer
35 views

Current best practice for timed job execution in Android

Since I'm struggling a lot with the Android Oreo background restriction, I was asking myself if working with the AlarmManager is even the best way of timing Job execution to e.g. 03:00 AM. I saw some ...
1
vote
3answers
48 views

How to add one hour repeately from start time till to next day start time using panda python

Here I have a csv file with data . I want to write a code that start time start from csv file time column first time and it will be equal as 0. Then from that time add one hour one hour till to next ...
1
vote
0answers
14 views

Time and Space complexity of BFS and DFS, on Graph in AdjacencyMatrix and AdjacencyList

i have performed BFS and DFS ( For printing the Graphs) --> with multiple Implementations. But I am confused with the time complexity of them, while reading online some say its O(V^2) . some say its O(...
2
votes
0answers
29 views

How to ignore DST when parsing string to time (Time.parse) in Ruby

I need to parse strings with timestamps and convert them to Time objects. I am struggling to understand how Time.parse works and how to ignore DST and use always UTC or simply convert to UTC I keep ...
0
votes
0answers
18 views

Need help to manipulate time in R

Want to add time to a matrix element so that it can be incremented by 30 mins: In order to insert the starting element to run the loop by 30 mins, trying this statement: Also once inserted need to ...
0
votes
0answers
23 views

Setting a timeout on synchronous file write without wasting microseconds with time()

I'm currently interfacing my PC with a microcontroller that is very sensitive with timing. In fact, I'll be lucky if I have a couple dozen microseconds to play with between sending the last byte and ...
0
votes
1answer
19 views

Oracle SQL - Shows all jobs logged after 5pm

Im trying to produce a report that shows all jobs that were logged after 5pm The code I've got so far is select job.job_number, job.job_entry_date, job.site_code, JOB.JOB_ENTRY_DATE ...
2
votes
2answers
56 views

How to add 2 minutes in given time (HH:MM:SS) in Node?

I have a time say for eg : 10:59:02 Now i need to add 2 minutes here & it should give me time as 11:01:02. I tried but was not able to achieve Can anyone help me with this ?
0
votes
1answer
25 views

Kivy: Send Notification at certain time

I would like to send a notification at a certain time (That I can specify) that can send even when the app is not in use. I have seen a few examples of this, but not in kivy. If anyone could give me ...
0
votes
1answer
30 views

Time function seems to always be increasing in my Python Fibonacci program

I'm trying to use a timer to see how fast each function is. My codes work but after running it many times I get slightly different results and wonder if I'm implementing function correctly. I am ...
1
vote
3answers
69 views

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 ...
0
votes
0answers
10 views

Inaccurate time results for Isochrone transit API request

I get inaccurate results by trying to find out how long it takes to travel from a bus stop to all other stations in a timeframe of 59 minutes with your api. This is the api call I use without my ...
1
vote
1answer
43 views

How to get difference between timestamps (either between strings or time.time) [duplicate]

I have one problem: I need to know the difference/duration between two timestamps in golang. Therefore, I use the time library (https://golang.org/pkg/time/). If I have two timestamps of type "time....
1
vote
1answer
27 views

How to Add minute to EventdateTime and convert to DateTime

I am using Google API, and I need to add minutes to an EventDateTime and send it back in DateTime format. req.setTimeMin(start.getDateTime()); start is an EventDateTime and I can convert it to ...
1
vote
0answers
40 views

Format Date with readable type for specific Locale / Country [duplicate]

In project there is few usage of DateUtils.formatDateTime() which is ignoring custom Locale. So I want to replace it somehow with custom locale and readable type for specific Locale. What it means:...
1
vote
1answer
61 views

How to speed up awk command in linux?

I am using awk command in linux to convert utc to localtime, but the file size is huge (>30 gb) and it would cost more than an hour. Here is my code: awk -F"," '{cmd="date -d \"$(date -d \""$1"\")-...
0
votes
0answers
51 views

Put string of “00:00” into DateTime so it is 12pm [duplicate]

I can't seem to enter 12pm into the DateTime. This is my Code: string a ="00:00"; DateTime applyClock = DateTime.ParseExact(a, "H:mm", System.Globalization.CultureInfo.CurrentCulture); The string ...
-1
votes
1answer
26 views

How to highlight first record between time interval in Excel?

I have a table that looks like this: ClientID Name Date 1 John 5/1/19 12:00 AM 1 Andrew 5/1/19 12:16 AM 1 Robert 5/1/19 12:40 AM 2 Alex 5/2/19 12:...
-1
votes
2answers
44 views

How to create javascript date object from html input type time?

This question answers how to convert HH:mm:ss string into a Javascript date object. The string returned from HTML time input is not always in the HH:mm:ss format. The format varies. The answers in ...
0
votes
1answer
31 views

Change time format from 1/1/1900 10:00:00 PM to 10:00 PM

I'm currently building a program to track the Login in / out, the data is exported as a string like this "5:00AM", I use the following code to convert the data from string to datetime64[ns] df = pd....
-2
votes
2answers
38 views

how convert to corrrect format string (31/July/2019) to DateTime format yyyyMMdd (20190631)

I'm trying to make a time validation, but when converting the string to time (fecha) an error occurs with the conversion and I can not generate the validation. before they ask, if you try to find the ...
1
vote
3answers
58 views

How to add time delay to process more than 15 second in Actionscript?

So I have the following script to get all combination of an array : ''' var value = new Array(40) for (var i=0;i<value.length;i++){ value[i]=i; } var comb_list = getAllComb(value,24); trace(...
0
votes
2answers
34 views

How to restart current seconds to 59 and start counting down

I'm trying to make a break timer. I can get the current second value, but I don't know how to reset the seconds and start counting down I've tried several formulas found here on stack overflow, but ...
-2
votes
1answer
39 views

Time JSON marshals to 0 time

I have the following code which primarily marshals and un-marshals a time struct. Here is the code package main import ( "fmt" "time" "encoding/json" ) type check struct{ A time....
0
votes
1answer
45 views

How do you round time to the nearest but also change the date in a NodaTime adjuster?

I have to round various LocalDateTime and OffsetDateTime objects to the nearest period of time (always minutes). For example, if you are rounding to the nearest 3 minutes, 9:58 would round to 9:57, ...
0
votes
1answer
12 views

How to work out difference between H:i times on a 24 hour clock?

I am creating something that calculates fees based on the duration of a nightly event. Sometimes these events go over into the early hours of the following morning. I have a table in my database that ...
0
votes
0answers
7 views

show processing time in jquery pop modal

I want to show a ticking seconds in modal popup. This will show how long it is taking to process a request. Present I used a gif image but I want to add seconds in the modal. Is there a way to display ...
1
vote
1answer
30 views

What the differences between clk_id of clock_gettime system-call

I tried to get the time through: int clock_gettime(clockid_t clk_id, struct timespec *tp) I am confused about what clk_id I should put. There is: CLOCK_REALTIME CLOCK_REALTIME_COARSE ...
1
vote
4answers
81 views

C++: setting time using suffixes

Tell me, Can the following exist in C ++ 11/14/17: 1) set time using time suffixes double time1 = 1s; // time1 = 1.0 double time2 = 2m; // time2 = 120.0 double time3 = 7ms; // time3 = 0.007 2) get ...
1
vote
1answer
21 views

SSRS Format Time field without colon

I have an expression to return the time of execution on my report: =Code.fnDocType(Fields,Parameters) & " " & TRIM(Fields!SOP10100_SOPNUMBE.Value) & TRIM(FormatDateTime(Globals!...
0
votes
3answers
46 views

Check if time is between two values - always return 0

I have a function to show an alert if time is between two values. Eg: start = 07:00:00 end = 17:00:00 assert start != null; int from = Integer.valueOf(start.replace(":", "")...

http://mssss.yulina-kosm.ru