Questions tagged [time]

Determining the duration required for executing a task. Additionally, inquiries regarding acquiring the present timestamp, computations involving timestamps, arranging and analyzing time data, etc.

Managing time in an Angular application using Typescript

I am facing an issue with formatting the time obtained from an API in my FormArray. The time is received in the format: 14.21.00 My goal is to convert this time to the following format: 2:21 PM I have attempted to format it using Angular's DatePip ...

Python Scrap Data Project

I attempted to extract data using Xpath, but unfortunately, it was unsuccessful. My aim is for the code to retrieve information from specific columns on the website "https://www.destatis.de/DE/Themen/Gesellschaft-Umwelt/Bevoelkerung/Geburten/Tabellen/leben ...

Calculating the time gap between two consecutive "keyup" occurrences

I am in need of creating a basic point of sale system using Javascript. I have a barcode scanner that functions like a keyboard. My goal is to automatically identify when the input is coming from the barcode scanner and then generate a report with the sc ...

How can we automatically disable premium memberships in PHP and MySQL after a set period of time?

I recently discovered how to implement PayPal IPN for upgrading users to a premium membership upon payment. After clicking on the upgrade account button, users are directed to PayPal for payment and then the IPN system updates the database to reflect their ...

Looking into time zones that do not observe daylight saving time

My code successfully converts timezones to GMT/UTC and vice-versa. However, I am looking to enhance its functionality by checking for non-DST timezones and allowing for dates/times in any format. For example, if only a date is provided, the correct result ...

What is the correct way to utilize Carbon::setTestNow() function in PHP?

When conducting tests, I need to specify a particular date for accuracy. I attempted to achieve this by utilizing the Carbon library, but encountered issues: Carbon::setTestNow(Carbon::createFromDate(2000, 1, 1)); printf(date("Y-m-d H:i:s")); // prints 20 ...

PHP Code to iterate over a range of time

Currently, I have a function that generates a list of options in a select input. These options represent times with 5-minute intervals. However, there is an issue when the time reaches values like 23:45, as the options start from 00:10 and continue looping ...

Tips on proceeding with this countdown

I have a start date stored in the database Now, I retrieve the current date which is assumed to be in UTC timezone class Datecalc { public $year; public $month; public $day; public $hour; public $minute; public $second; fun ...

Is there a way to include the present date and time within a mat-form-field component in Angular?

I'm working on a mat-form-field to display the current time inside an input field. I've managed to insert it, but I'm struggling with the styling. Here's the snippet of code I'm using: <mat-label>Filing Time:</mat-label><br> ...

What is the best way to adjust the time intervals in a time series dataframe to display average values for

I understand that pandas resample function has an **hourly** rule, but it currently calculates the average for each hour across the entire dataset. When I use the method (df.Value.resample('H').mean()), the output looks like this: Time&d ...

Transforming a pre-existing date format into a new structure using regular expressions

When I have $date = $run['at'];, the output is 2013-06-03T16:52:24Z. How can I modify it to extract "d M Y, H:i" format for example? ...

Can you provide me with a timestamp for the stroke of midnight today?

Can someone please guide me on how to obtain a timestamp in php for today at midnight? For instance, if it's currently Monday at 5 PM and I'm looking to get the Timestamp for the same day (Monday) at midnight (12 am). Any assistance would be greatly appre ...

Combine elements of a tuple to create a coherent date and time structure

I've taken up the challenge of learning Python through practical applications. To start off, I have a basic log file: LOGON, Thu 30-01-2014, 12:38:01,11, username1, machinename LOGOFF, Thu 30-01-2014, 12:56:41,57, username2, machinename LOGON, Thu 30-01 ...

Remove the option to select specific minutes from the time input on an HTML

My HTML code includes a time input that looks like this: <input id="appt-time" type="time" name="appt-time" value="13:30" /> I want to figure out how I can remove the minutes from the input or ensure that the ...

Click the button to insert a time stamp into the text area

Whenever the id=dodaj_godzine_button is clicked, I would like to add the current time to id=formularz_wpis_tresc (as a string). I attempted to do this using the code below, but it seems to be malfunctioning. $("#dodaj_godzine_button").click(function(){ ...

GAS: What strategies can I implement to optimize the speed of this script?

I have a sheet with multiple rows connected by "";" and I want to expand the strings while preserving the table IDs. ID Column X: Joined Rows 01 a;bcdfh;345;xyw... 02 aqwx;tyuio;345;xyw... 03 wxcv;gth;2364;x89... function expand_j ...

Issue with updating Python global variable with new value

global endGame endGame = False def time_up(): global endGame endGame = True I seem to be encountering an issue where the endGame variable is not being properly updated with the new value. I am attempting to set it to True in order to stop a while l ...

Capture the moment a button is clicked, save it in the database, and showcase it on the page using React

This might be a challenging question, but I'm up for the challenge! I'm currently working on a website using the MERN stack, and I'd like to implement a feature where users can click a button that says "check-in", which would then store the time they click ...

Increasing efficiency by storing intermediate results and referencing them when needed

Currently, I am utilizing the spacy library for natural language processing to assign particular attributes to a large amount of data consisting of over 100,000 questions and answers. The process of assigning these attributes takes approximately one minute ...

Get rid of the arrow that is displayed when using the `time` input type in HTML5

Recently, I encountered an issue with the default HTML5 code snippet. My custom background looked perfect except for a pesky black arrow appearing on the right side. In this image, you can see the problematic black arrow that needs to be removed. I attemp ...

Is there a way to deactivate or dim a specific hour in an HTML time form?

I am currently facing a challenge with my booking form. I need to find a way to grey-out or disable the hours/times that have already been booked by previous customers. This will help ensure that the next person can select a different time slot. However, I ...

Moment JS initialization and the utc() function

I am trying to comprehend the way Moment JS initializes its moment object. For instance, let's say I want to create a moment for the date and time: April 1, 2000, 3:25:00 AM with a UTC offset of +8 hours from UTC/GMT. To represent this in JavaScript, I u ...

I require assistance in determining the difference between two times as I am currently unable to obtain the results I

After experimenting with different methods, I have found some challenges in calculating the time difference between two values separated by a colon. The times are received through an XML feed, giving me the flexibility to manipulate and convert the strings ...

Executing multiple jar files in Python using multithreading results in longer execution times

I am currently utilizing ThreadPoolExecutor and assigning identical tasks to workers. The task involves running a jar file and performing certain operations on it, but I have encountered an issue related to timing. Scenario 1: When I submit a single task ...

How can I calculate the total number of days between the from_date and to_date using PHP in CodeIgniter?

$from_date = $this->input->post('from_date');12/3/2016 $to_date = $this->input->post('to_date');14/3/2016 I am looking for a solution that will provide me with the total number of days between two dates. For example, consid ...

Fluctuating time of Tensorflow operations

My objective is to accurately measure the time it takes for my session to execute inference operations. To do this, I used the time function in the following manner: start = time.clock() sess.run([ops['pred']], feed_dict=feed_dict) end = time.clock() elap ...

PHP: Retrieving the current time zone from the database

In my database, I save dates in DATETIME format as Y-m-d H:i:s. My goal is to display the date from the database in the user's local time. For instance, if the user is located in France, I want to show their timezone. Is there a way to accomplish thi ...

Obtain the query response time/duration using react-query

Currently utilizing the useQuery function from react-query. I am interested in determining the duration between when the query was initiated and when it successfully completed. I have been unable to identify this information using the return type or para ...

Converting Ordinal Time to Date-Time using Python

I need help converting a specific ordinal time array (shown below) to date-time format (YYYY-MM-DD hh:mm:ss.sss) in Anaconda/Python 3. I have searched for solutions to this issue, but none take into account the decimal precision of the original data. The ...

CakePHP 3.6 encountered an issue where it could not convert an object of the class CakeI18nFrozenTime to an integer

In my index.ctp file, I am attempting to determine if a date is more recent than one week ago: (((!isset($task->date_end) || is_null($task->date_end))? strotime('now') : $task->date_end) > strtotime('-1 week')) However, I am encounte ...

Enhancing a variable's value while simultaneously boosting its rate of increase through Javascript

Looking to adjust the timing on a number increase function using setInterval(Function, time). Initially set the variable for time as time = 1000, but now looking to dynamically change it by implementing a function triggered by a button click: function cha ...

Renaming the month in Material-UI React

Using DatePicker from Material Ui, I am trying to change the name of the month. How can this be achieved? For instance, I need to change August to Avqust or March to Mart enter image description here This is my code: <LocalizationProvider ...

Timing the execution of each step in JUnit

Struggling with a task for the past 2 days that involves running a JUnit test on JMeter. Here's the code snippet: public class LoadTest5 extends TestCase { private WebDriver driver; public LoadTest5(){} public LoadTest5(String testName){ super( ...

Learn how to subtract time in PHP while accounting for AM/PM

I need assistance with time formatting. Currently, I have: $start_time; (e.g. 1:30 PM) $system_time; (e.g. 8:20 AM) echo $time_left_for_discussion = $start_time - $system_time; When trying to subtract $start_time - $system_time, the result is not ...

A step-by-step guide on utilizing moment.js to format the data provided by a vuetify v-text-field (with the type: time)

Currently, I have set up this element in the code: <v-text-field label="Choose a time" type="time" mask="time" step="1800" prepend-inner-icon="access_time" v-model="expiryTime" :rules="[v => !!v || 'Time is required']" required @ch ...

When the query result is received in Angular TypeScript, translate epoch time into a time string

Here is the dilemma I am currently facing: I have an Angular script that requests data from a backend service and receives query results to display to the user. One of the fields in the query response is a time stamp, which is currently in epoch time forma ...

How can we group data by minute, hour, day, month, and year?

I've been trying to find a resolution for my current issue, but I seem to be stuck. I'm really hoping that you can assist me. The Issue: My goal is to determine the number of tweets per minute. Data Set: time sentiment 0 201 ...

What is the best way to implement a function in a discord.py command that restricts the use of a command to only once per minute?

What is the best way to ensure a command in discord.py can only be used once every minute? @bot.command() async def busk(ctx): member = ctx.message.author.id #gets the user ID, which i use as the _id in pymongo because everyones is different. ...

Using Wordpress to convert seconds into a combination of minutes and seconds

I have a custom field named duration, with values represented in seconds. To display it within a post, I currently use: <?php echo get_post_meta($post->ID, 'key', true); ?> <?php echo get_post_meta($post->ID, 'duration', true); ?> My q ...

Attempting to transform a mysql timestamp into standard time by utilizing the strtotime function

strtotime($_SESSION['starting_timestamp']) I attempted to convert the MySQL timestamp stored as $_SESSION['starting_timestamp'], which has a value of 1422094831. However, when I applied strtotime function on it, it did not return any value. I am unsure a ...