Most voted "time" questions
Use this tag when the question refers to some resource, information or function-related problem for calculating or manipulating time variables.
Learn more…109 questions
Sort by count of
-
37
votes5
answers409
viewsToday (06/30/2015) we will have a second more, what could be the consequences for our systems?
In case anyone doesn’t know, today 30/06/2015 We’ll have an extra second. That is, today after the 23h59m59s we shall have 23h59m60s! This to make the correction of International Atomic Time. I know…
-
28
votes4
answers6985
viewsHow to add times in Java?
I am working on a report that makes a sum of the data and part of the data is times, example: ----------------------- | Atividade | Tempo | ----------------------- | 1 | 11:00:00 |…
-
16
votes2
answers8360
viewsWhat do GMT and UTC stand for?
I recently discovered Unix Timestamp and I came across the acronyms GMT and UTC, I would like to know what they mean. I’ve already done some research, but I didn’t find anything very clear.
-
12
votes4
answers23451
viewsHow to convert seconds to "Hour:Minute:Second" format?
How can I convert a value in seconds to a format of 'hours:minutes:seconds'. Example: 685 converted to 00:11:25 As I can do?
-
6
votes1
answer263
viewsInsert into an array between certain values
I have two values in time format, 20:03:02 and 20:03:35, who are in a array in Lua. hora_array={"20:03:02", "20:03:35"} The difference between the two values is 33 seconds (20:03:02 - 20:03:35 =…
-
6
votes1
answer223
viewsComparison of PHP schedules
date_default_timezone_set ( "America/Sao_Paulo" ); $dtz = new DateTimeZone('America/Sao_Paulo'); $dt = new DateTime('now', $dtz); $offset = $dtz->getOffset( $dt ) / 3600; $por_do_sol =…
-
6
votes4
answers941
viewsTime Sync() PHP and Javascript
if I generate a time() on the PC purchased in Brazil it will result a team according to our time and such, if I repeat the process in China, USA or any other place with a local PC or time() will be…
-
5
votes4
answers4168
viewsConvert string to Time
I got a column in the database that gets a guy varchar which corresponds the hours on my app ("HH:MM"). I need to convert this string to a type TIME and then concatenate with a type DateTime.…
-
5
votes1
answer130
viewsTime is early in program . C
I have an application in .c, I finished it but I have a problem with the time. Example: I am recording everything that is done with date and time only the time is early. When I do an operation at…
-
5
votes2
answers179
viewsObject type for Time type data (Ex: 1 min 56 seconds) in Android/Java?
I need to work with times, such as a chronometer (not my case), which at the end of its execution would have to keep its value. So I thought of some possibilities like: java.utils.Date: only that…
-
5
votes1
answer2036
viewsWhat type should I use to save only the time (no date) in a database?
I am in doubt which type I should use to work with hours on my system. I should use DateTime, Time or TimeStamp. I would like the hours to be saved in this format: HH:MM…
-
5
votes1
answer2373
viewsHow can I get the current date and time in #R?
I am creating a routine process report, a simplified "logfile", and would like to store the date the time of the error moment in a variable. What function results in the date and time of the moment…
-
5
votes1
answer95
viewsWhere is the function taking the current time?
I have a function that returns the current time. Where does this value come from? Phone time? Server? Just follow my lead: public static Date getAgora() { Calendar calendar = Calendar.getInstance();…
-
5
votes4
answers130
viewsString Manipulation in Javascript?
I have the following code var wcalcAlm = ('0140') alert(wcalcAlm) //retorno esperado ('01:40') I need that after the 2 position of the variable wcalcAlm be included :, thus having the following…
-
4
votes2
answers3962
viewsTaking System Time in C
I want to take the time of beginning and end of a for. Ex.: #include <stdio.h> #include <time.h> int main () { time_t rawtime; struct tm * timeinfo; int i, j; time ( &rawtime );…
-
4
votes1
answer1711
views -
4
votes1
answer6466
viewsAdd Mysql Time Field
Dear friends, I have a table with a TIME column, which stores the time worked on the day, and I am trying to sum up these times at the end of a month, but without success. I used the following…
-
4
votes1
answer12788
viewsRounding of hours (every 30 minutes)
Does anyone have any idea of any logic for rounding the hour, but every 30 minutes? Example: vem assim -> vira assim 15:34:32 -> 15:30 15:47:21 -> 15:30 16:00:40 -> 16:00 17:28:30 ->…
-
4
votes6
answers3314
viewsGet the local time in javascript with zeros?
I’m trying to get local time and minute in javascript. The first way I tried was this: date = new Date; date.getHours() + ':' + date.getMinutes() // 10:5 But for the time of 10 hours and 05 minutes,…
-
4
votes1
answer1406
viewsDoubt about System.currentTimeMillis()
I was discussing with a friend now little about the origin of the number that results from this method. Where does it come from? It has been counted since when? It reset?
-
3
votes1
answer278
viewsI get NA when I convert Character to time (Posixlt)
Why do I get NA when I do this conversion from Character to Posixlt? library(bReeze) data(winddata) tempo <- winddata[,1] tempo[1:6] # Preview # [1] "06.05.2009 11:20" "06.05.2009 11:30"…
-
3
votes1
answer196
viewsHow do you get time for a millisecond?
I would like to take the time (HH:MM:SS) per millisecond. Ex: 86400000 Would be: 24:00:00 since it is the equivalent of a day.
-
3
votes3
answers656
viewsCommands as. Date and srtptime in R
Suppose the following vector: datas=c("26/12/2014", "27/12/2014", "28/12/2014", "29/12/2014", "30/12/2014", "31/12/2014") When applying the commands as.Date(datas, "%d/%m%y") and strptimes(datas,…
-
3
votes1
answer48
viewsProfile network java (jdbc)
What tool can I use to evaluate the response time of a request (jdbc) Ex: query = "SELECT * FROM v$version WHERE banner LIKE '%Oracle%'"; ResultSet rs = stmt.executeQuery(query); // linha de cima ⋀…
-
3
votes1
answer300
viewsHow do you make sure it’s another day?
I’m making an application where a feature is available until a condition is reached, after that I have to disable the functionality and only enable it the other day. How do I know it’s another day?…
-
3
votes3
answers7601
viewsGet time and date independent of system time
Well, I’m having trouble getting the date and time in Javascript when the computer, or the system has this incorrect data. Official time: 08:35 - 07/14/2016 - Brazilian Time Computer time: 23:46 -…
-
3
votes2
answers7430
viewsCalculate time interval in hours and minutes considering different days
For now I have this code that is calculating the interval between the hours. I want to increment the calculation with minutes, and I want to make some changes in logic, for example when I put the…
-
3
votes2
answers1191
viewsDoing operations/handling Datetime
The idea is for the user to type in a textbox to horaEntrada and in another to horaSaida where in the case of these two variables they should have the format "HH:mm" hours and minutes only…
-
3
votes2
answers2053
viewsTime comparison
Please, I’m trying to compare hours (like Open Now / Closed Now). But I’m not getting it. To save the current time, I’m using: object.put("h11", h11.getText().toString()); object.put("h22",…
-
3
votes1
answer75
viewsIs there an online service that requests at a given url?
I need a requisition made GET in a url every 5 minutes. Is there any free service that does this?
-
3
votes2
answers1981
viewsHow to subtract hours in java?
I am trying to days make the difference of hours in my application. The case is as follows: Based on the Current time and current minute, I want to compare another time I have in a string and I need…
-
3
votes1
answer272
viewsRunning time in C
I would like to take the runtime in milliseconds of an application, I did the following algorithm. double writingFS(char* Filepath, char* PenDrivepath, clock_t* thput) { clock_t t1, t2; long size =…
-
2
votes1
answer257
viewsCalculate x in x seconds
I have this code that calculates in 1 second in 1 second between a certain time and then insert into a table. Instead of calculating every 1 second, how can I calculate, for example, every 5…
-
2
votes1
answer61
views -
2
votes2
answers1234
viewsCalculate hours in PHP?
I am developing an electronic point in PHP and I would like to know how to do the Caculo of two hours being that one of them is negative, for example: Workload day 1: -05:00:00 Workload day 2:…
-
2
votes2
answers1489
viewsDifference between two PHP dates in 31, 28 and 29 day months
I have a bonus system that only releases the bonus after 30 days of exact user registration. To compare the current date with the date of the user’s registration so that I get how many days to…
-
2
votes1
answer13579
viewsCalculate time difference in php
I am trying to show how many hours an employee has worked, however the ways I tried presented incorrect values. Follow the same below: This returns the difference with 3 hours and 2 minutes less:…
-
2
votes1
answer122
viewsCreating a Ruby Commitment Schedule
I want to create a kind of routine that Intercale time interval Example: 8:00 to 12:00 with 30 Minutes interval A sample of the code class Appointment < ActiveRecord::Base has_many :schedules def…
-
2
votes0
answers74
viewsStore time in TIME type field greater than 838:59:59 in Mysql
Good afternoon, Could someone help me with this? I am in need of storing values longer than 838:59:59 in the TIME field in Mysql. Is there any alternative for the TIME type to be able to store value…
-
2
votes1
answer192
viewsHow to suspend a command without disturbing active commands
well I wanted to know if you know a command in python that suspends the operation of a command (for a few seconds)without disturbing the other commands that are active, because it was wanting to…
-
2
votes2
answers290
views -
2
votes2
answers233
viewsPlot time series on defined scale
I have a time series record, and I’m having trouble plotting on an appropriate scale. Take this example: #Gerar sinal v1 v1=sin(seq(from=0, to=3*2*pi, length=11060)) #Gerar sinal v2…
-
2
votes1
answer143
viewsWhen to use UNIX_TIMESTAMP
Absolutely, we all work with dates, timestamp, among other forms and various formats. The UNIX_TIMESTAMP (the time in seconds from '1970-01-01 00:00:00' UTC to date) always ends up appearing…
-
2
votes1
answer51
viewsTime leaving with unexpected result
I’m running a code that prints the hours on the terminal but when I use the code below it brings me a totally wrong value on time: Code: from time import gmtime, strftime print(strftime("%a, %d %b…
-
2
votes1
answer116
viewsHow to convert 39 hours to 'TIME' type
To accomplish a certain task, I count in my system the time spent of the respective task. Today I came across the following: Data Inicial: 17/12/2018 16:49:14 Data Final: 19/12/2018 08:02:58…
-
2
votes1
answer960
viewsHow to run a function after a certain time in Pygame?
I’m making a game with Python, in which character jumps obstacles and falls after a few seconds. In javascript I used the setTimeOut function for this. In Python I tried to do the same thing with…
-
2
votes2
answers203
viewsdate.getHours with 0 more elegant
I need to assemble a JSON with a property in hours and minutes. I use a Timepicker on the front and it returns a date: Fri Feb 15 2019 05:52:09 GMT-0200 (Horário de Verão de Brasília) To build JSON…
-
2
votes4
answers254
viewsSet Golang Standard Timezone
Is there any way to set a standard Timezone (Location) in Golang so you don’t have to be on time? I am currently manually setting the Timezone every time I need to work with Time using it: loc, _ :=…
-
2
votes2
answers74
views -
1
votes2
answers756
viewsTreat ranges between two Time Mysql fields
I have a table Atendimento in my comic book. Inside it I have two fields that are: HrIni which refers to the initial and other time HrFim which refers to the final time. I need each record of these…