31,530 questions
-1
votes
0
answers
11
views
How to calculate difference between two date/time stamps, in specific format (YYYYMMDD.HHMMSS.MS), with labeled output, in batch file
Yes, unfortunately, the solution has to be a batch file due to the age of the system (no PowerShell). Additionally, since I have no experience with batch language (for lack of a better word), I have ...
-1
votes
1
answer
68
views
How to detect or mitigate wall-clock time jumps when validating offline software licenses?
I’m implementing an offline license validation mechanism in a desktop/server application.
The license has an expiration date and must continue to work without any online checks.
The problem I’m facing ...
3
votes
1
answer
128
views
How to assign a std::string from std::put_time in C++?
I need to set the result from std::put_time from ctime into a std::string, how do I do this ?
Here is my code:
BBToolkit::LogManager::LogManager() {
auto t = std::time(nullptr);
auto tm = *std:...
Best practices
3
votes
4
replies
89
views
PostgreSQL: Should I store timestamps as UNIX epoch or timestamptz?
I'm dealing with a timezone issue in a PostgreSQL project and would like some advice.
I'm currently choosing between two ways to store timestamps:
1. UNIX timestamp (bigint)
Very safe in terms of ...
2
votes
1
answer
78
views
Storing store time of day ranges where timezone matters
I need to store some store hours that exist in different time zones and may be interacted with in different timezones through an admin portal where it will display store time and local time.
I know ...
Advice
0
votes
4
replies
162
views
Why is my O(nlogn) solution faster than the O(n) solution
here is my solution to the leetcode "longest consecutive sequence" problem:
class Solution:
def longestConsecutive(self, nums: List[int]) -> int:
if len(nums) == 0:
...
9
votes
2
answers
719
views
Using Chrono, how can I get millisecond precision?
C++, using <chrono>, I would like to get a value formatted as <seconds>.<milliseconds>. I am using system_clock and get the current seconds as:
auto secs = duration_cast<seconds&...
1
vote
1
answer
191
views
How can I create a `onClick` event for the timer in the events section?
The program I am using has a small section for programming which is almost similar to the Delphi programming language.
In the components section, there is no timer and I want to create it myself.
{$...
1
vote
1
answer
72
views
modpost GPL error using ktime_* - what to use instead?
I'm building a non-GPL kernel module (non-negotiable) and in order to get timing information everywhere I look here and elsewhere tells me to use the new ktime_* API, but when I build I get this error:...
0
votes
1
answer
135
views
Import timestamp from Rstudio to Snowflake changes timezone
I'm exporting some data from Snowflake to Rstudio and do some data processing. After that I write the data back to Snowflake. The problem is that somehow the timestamp initiale from Snowflake is ...
-1
votes
0
answers
44
views
Engine.update not advancing simulation ( having trouble with deltaTime )
so i am trying to run a matter instance in a worker thread.
Im running it with my own loop as shown below. However I'm experiencing trouble with game pacing. Before getting to the explanation here is ...
1
vote
1
answer
61
views
Identifying and summing time values across a row in Google Sheets
I am creating an activity tracker in Google Sheets:
In column B, I want to be able to track the total time doing activity ("Ac.") B. So I want to be able to sum the difference between (in ...
-3
votes
1
answer
69
views
Pause loop to make a certain action then continue where you left off inside of it
import pyautogui
import time
def RunD(Down, Up): #Up is the parameter that creates the delay
pyautogui.keyDown('d')
pyautogui.mouseDown(button='left')
time.sleep(Down)
pyautogui.keyUp('...
1
vote
3
answers
196
views
Reducing Latency in Pixel Scanning for Input Simulation
I am developing a Python script to pass a challenging minigame in a single-player title. My goal is to unlock a specific achievement within this game, a task I've spent over 10 hours attempting ...
0
votes
0
answers
65
views
What is the fastest way to compute a filter in Fourier space?
I am currently working on a beam propagation code. The code basically consists of a transversal profile (a 2000x2000 array) which is propagated a small distance, then has its borders filtered, then ...
0
votes
1
answer
66
views
How in python can I transform negative secs into struct time? [duplicate]
I'd like to transform -238204800 seconds to "1962:06:15 00:00:00", using python 3.8.
My code is :
from time import strftime, localtime
secs = -238204800
print(strftime("%Y:%m:%d %H:%M:%...
0
votes
1
answer
187
views
Why can consecutive calls to perf_counter_ns on windows return the same number?
Using the below code I would have assumed so see cnt be close to 0, but on Windows I see only values above 500,000.
from time import *
def test_time(f, c):
cnt = 0
for i in range(c):
...
1
vote
2
answers
587
views
How to make a mock for time.Now() in Go unit test
I have been reading various ways of making a mock for time.Now() and try to make the unit test.
Let's say we have a Customer struct.
type Customer struct {
Name string
CreatedDate sql....
3
votes
0
answers
85
views
How to get accurate timing with PyQT
I'm trying to build an app that will accurately count time between taps, like a tap function on a metronome but finding the results to be inaccurate;
current_time = QDateTime.currentMSecsSinceEpoch ()
...
-1
votes
1
answer
63
views
Sorting text lines by a field formatted as time stamp with shell commands [closed]
I want to sort lines with time format strings using shell command.
Shell shall be a common linux shell.
Example input:
results/fn_a:# Generated on: Mon Jul 21 17:20:48 2025
results/fn_b:# ...
0
votes
1
answer
64
views
How to summarize Spark executor computing time
I have a spark job running with 260K tasks. I can check individual task executor computing time from Spark UI.
For the purpose of calculate resource usage of the whole job, how to summarize all ...
0
votes
0
answers
122
views
Problem refreshing excel data from Python Script
I have a python code that theoretically downloads data to an excel file and then uses the refresh all command for it to execute some Power Query on the downloaded data.
import os
import shutil
import ...
0
votes
2
answers
105
views
Imported rowing data and trying to reformat into MM:SS.MS format (minutes:seconds.milliseconds)
When I import my data into R it is truncated.
For example the raw data is 01:35.2 when I look in Microsoft Excel but it shows in the column as 01:35:00.
I've included the packages I've used below.
...
0
votes
1
answer
53
views
/usr/bin/time -v on cached file : why are file inputs showing as non zero?
My program reads from a file that is already in the page cache
cat foo >> /dev/null
I run /usr/bin/time -v on it and I still see file inputs is not zero, AND it increases
as I read more of the ...
-2
votes
2
answers
266
views
Why does Java Date always display in system time zone instead of UTC?
I am working on a Java 8 application where I receive epoch millisecond timestamps that represent UTC time. I need to pass these timestamps as Date objects to a method that I do not control (from a ...
2
votes
3
answers
121
views
How to add exactly 1 millisecond to a Swift Date
Working with Swift 5.0 in Xcode 16.4. I have a Date instance and I would like to add exactly 1 millisecond to it.
Date.addingTimeInterval(TimeInterval) and friends appear to be relevant methods. ...
1
vote
1
answer
38
views
Is there's an easy way to give valgrind client the illusion of (plausible) real time
If I run a program under valgrind that also keeps track of time, is there a way to make it get plausible results given the amount of code it has executed.
What I'm planning to do is to run GStreamer ...
2
votes
1
answer
68
views
wrong duration result with chrono duration delta time
i want to calculate delta time and use it to consume the input duration, in a while loop like in the code block:
void _Test_duration_print(float duration)
{
using chrono_clock = std::chrono::...
2
votes
1
answer
86
views
Editing "parts" of a TIMESTAMPTZ value
I have a TIMESTAMPTZ column in a Postgresql database. To my understanding, Postgresql does not preserve the timezone within a TIMESTAMPTZ column, and instead converts the given timestamp to an ...
0
votes
1
answer
84
views
Event load can't be found BC30590
I comeback with an error BC30590 the event Load can't be flound. I want to display date and time on a mMain form This is the code but is not working. Thank you very much.
Public Class MainForm
...
3
votes
1
answer
140
views
Does System.nanoTime() pause when the machine sleeps?
I'm tracking a bug in my software that is caused by System.nanoTime() stopping counting time when the machine enters a deep sleep state, whereas System.currentTimeMillis() does not.
Here's a minimal ...
-1
votes
2
answers
68
views
How optimize this code for reduce the execution time?
I am developing a small Python program that simulates pressing, holding, and releasing keys with random delays. This is intended to make the process look more natural, as if a real person is typing ...
0
votes
1
answer
72
views
Summing event durations in SQL with input time range, accounting for splitting event times, and incomplete events for OEE
I need to calculate OEE (Overall Equipment Effectiveness) for a set of production data given a start and end timestamp.
The value I'm stuck on is Availability %, which is (time running/time requested) ...
0
votes
1
answer
37
views
Round a varchar2 column with a value of 00:00:00:00.000000
The data occasionally returns days:hours:minutes:seconds.0000 but is usually hours:minutes:seconds.0000 and the field in the table is a varchar2
Examples
01:04:23:14.679012 and
00:06:35:35.453899
I ...
0
votes
0
answers
88
views
Slurm srun fails with "Munge decode failed: Rewound credential" due to persistent time sync issue
I'm setting up a Slurm cluster (Controller: talbn, Compute: node1, Slurm v23.11.4 on Ubuntu). I've been troubleshooting various issues and believed I had resolved all Munge and time synchronization ...
0
votes
0
answers
26
views
azure synapse Processing time
When my Azure pipelines are triggered automatically, my processing time takes 1 hour... when I run it manually, it takes 30 minutes... why this difference could be happening... even if my pipelines do ...
0
votes
1
answer
77
views
How to associate minimum and maximum time to effect to a FHIR resource?
I'm working on a project to migrate a legacy healthcare system to FHIR, and I need help mapping the current SQL-based fields to the appropriate FHIR resources.
The goal is to enable API integrations ...
0
votes
0
answers
43
views
POWER BI - How to show only the last week of each month in a bar chart?
I'm taking over an existing Power BI report, and I need help figuring out the best way to display only the last week of each month in a bar chart.
The current setup already includes measures that ...
1
vote
1
answer
107
views
Ansible "when" condition is being evaluated once per loop run [closed]
My goal is to run a task in a loop with a condition that when current time is greater than the time provided by user (endtime) loop should not be processed anymore.
Task looks like this:
- name: ...
3
votes
3
answers
208
views
Python time.strftime gives different results for %Z and %z
I'm getting some strange behavior when I pass a UTC time struct to python's time.strftime. Using %z seems to always give me my local offset rather than 0:
>>> import time
>>> a = ...
0
votes
1
answer
45
views
Combine dataframes fuzzy matching on time
I have two dataframes, dfA and dfB, whose primary key is an ID and a datetime object each stored in a column.
I wish to merge these dataframes on the ID & time if the ID is identical AND if the ...
0
votes
0
answers
116
views
Unexpected modification time of created file
I'm writing a unit test of a component that creates a file, specifically the case where it doesn't set the file's modification time (mtime). I.e., I'm verifying that mtime is within the time range ...
3
votes
1
answer
287
views
Why does Instant.now() have a much higher precision on my Unix machine vs Windows?
To get a sense of how accurate Instant.now() is on various machines, I ran a very simple test to see how often the clock updated:
public class Test {
private static final Logger logger = ...
2
votes
1
answer
185
views
Why does System.nanoTime() accumulate error over the day?
I'm trying to measure the latency between my Java publisher and an (industry standard) Cpp message broker.
The broker records the time it receives each message, and for the Java publisher I'm using ...
1
vote
1
answer
173
views
Converting time.Time to datetime.DateTime
For some of our Protobuf DTOs, we use datetime.DateTime to represent the idea of a date and time with time zone. Internally, however, we work exclusively with time.Time objects because these have ...
1
vote
1
answer
43
views
How to omit minutes when formatting a time?
The following code is perfect.
Sub Macro1()
Dim mySecond As Double
mySecond = 75
Dim myMinute As Double
myMinute = mySecond / 86400
...
2
votes
3
answers
122
views
Group rows by group & overlapping time intervals & then keep highest priority row in R
I have a dataset as follows
data<- data.frame(group_ID= c("cred", "cred", "cred", "cyellow", "cyellow", "cgreen"),
...
-3
votes
2
answers
190
views
Does Instant.MAX need to be manually formatted? [closed]
DateTimeFormatter fails on valid Instants. How it is meant to format those below and above LocalDateTime.MIN and LocalDateTime.MAX? Manually?
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"...
2
votes
1
answer
132
views
How do I update text in toga?
I am trying to create a simple clock app, and for that, I am using time. I want to update the time label
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW
import time
...
0
votes
0
answers
104
views
Handling TimeSpan type conversion issue in .NET 8 with Fluent NHibernate after migrating from .NET Framework
Can someone help me? I'm encountering an issue with the TimeSpan datatype in .NET 8 using FluentNHibernate.Mapping.
To summarize, my project was initially on .NET Framework 4, and I recently migrated ...