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.

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. See also and .

For analysis in , consider looking at the Time Series Task View.

29686 questions
8
votes
3 answers

Golang gorm time data type conversion

Situation: I'm using a postgres database and have the following struct: type Building struct { ID int `json:"id,omitempty"` Name string `gorm:"size:255" json:"name,omitempty"` Lon string `gorm:"size:64" json:"lon,omitempty"` Lat …
Rustam Ibragimov
  • 2,571
  • 7
  • 22
  • 33
8
votes
2 answers

Convert 32 bit unix timestamp to std::string using std::chrono

I am trying to use std::chrono to make a std::string but running into issues. Here is the C(-ish) code I want to mimick: std::uint32_t time_date_stamp = 1484693089; char date[100]; struct tm *t = gmtime(reinterpret_cast
Ziggy
  • 95
  • 1
  • 5
8
votes
8 answers

How to sort object array by time in javascript

I have a object array looking something like this: [0] = { transportnumber: '45', time: '10:28:00', date:"2017-01-16"} [1] = { transportnumber: '45', time: '10:38:00', date:"2017-01-16"} [2] = { transportnumber: '45', time: '10:48:00',…
jaikl
  • 971
  • 2
  • 9
  • 23
8
votes
2 answers

How to find different elements of two time vectors?

Considering these two time vectors: a<-seq(as.POSIXct("2010-01-01 05:00:00"), as.POSIXct("2010-01-02 23:55:00"), by = '5 min') b<-seq(as.POSIXct("2010-01-01 00:00:00"), as.POSIXct("2010-01-03 23:55:00"), by = '10 min') How to get the different…
YQ.Wang
  • 1,090
  • 1
  • 17
  • 43
8
votes
2 answers

Python: how to Parse and check the time?

How do I extract the IP address that occurs 10 times within a one-second time interval? In the following case: 241.7118.197.10 28.252.8
Maria
  • 111
  • 5
8
votes
3 answers

Convert hours and minute to millisecond using javascript or jQuery

I have Hours:Minute format of time as string. To display it into highchart as time i need to convert this string into milliseconds. For example: 34:26 (34 hours and 26 minutes) millisecond is 124000000 How can i convert it to milliseconds using any…
Jitendra Solanki
  • 343
  • 2
  • 6
  • 23
8
votes
6 answers

Find the closest hour

I have a list with these items: hours = ['19:30', '20:10', '20:30', '21:00', '22:00'] Assuming that now it's 20:18, how can I get the '20:10' item from list? I want to use this to find the current running show in a TV Guide.
ov1d1u
  • 958
  • 1
  • 17
  • 38
8
votes
3 answers

How should I store a time_t timestamp to a file using C?

For a small todo program that I am writing, I have timestamps that are of this form time_t t = time(NULL); and are saved every time a task is entered to denote the time that it was entered. I want to store the tasks to a plain text file, so that…
Lazer
  • 90,700
  • 113
  • 281
  • 364
8
votes
2 answers

Does gettimeofday() on macOS use a system call?

I expect that gettimeofday() will call a system call to do the work of actually getting the time. However, running the following program #include #include #include int main(int argc, char const *argv[]) { …
asnr
  • 1,692
  • 1
  • 14
  • 17
8
votes
2 answers

Incrementing time (minutes and seconds) in bash / shell script

I need to increment minutes and seconds (in relation to time) in a variable. First, I'm not sure whether declaring a 'time' variable is written as time="00:00:00" or time=$(date +00:00:00)? From there, I want to increment this variable by 10…
cbros2008
  • 353
  • 1
  • 7
  • 23
8
votes
2 answers

Get current system time of a machine on the network

I understand that I can query system time of my machine like this: from datetime import datetime datetime.now() Is there a way to query the system time of another machine on the windows network? Eg of \\mynetworkpc.
SIndhu
  • 677
  • 3
  • 15
  • 21
8
votes
1 answer

PHP microtime() in javascript or angularjs

In PHP microtime() return the string in "microsec sec". php microtime() eg: '0.48445100 1470284726' In JavaScript there is no default function for microtime(). So divided the return type, where sec is in unix timestamp using date.getTime()…
Harish98
  • 445
  • 1
  • 7
  • 16
8
votes
1 answer

What are the alternative classes for localTime and localDate in Android?

I want to use long value I got from android API that return me dates as longs, represented as milliseconds since Epoch. I need to use methods like isBefore() plusDays() isAfter() Cursor managedCursor =…
user3341564
  • 182
  • 2
  • 17
8
votes
3 answers

Dealing with Eastern Standard Time (EST) and Eastern Daylight Savings (EDT) in R

I have a series of datasets from a water quality continuous monitoring probe with the Date and Time set in Eastern Standard Time (EST) so there is no correction of Daylight Savings Time (EDT). In R, the fields are recognized as factors when…
Paul Julian
  • 245
  • 1
  • 2
  • 7
8
votes
1 answer

Windows 7 daylight savings bug?

I am trying to determine exactly when a daylight savings transition occurs in a Perl script using Perl's localtime function and printing the time zone using strftime. The strange thing is this seems to work fine for this year and other more recent…
tjwrona1992
  • 8,614
  • 8
  • 35
  • 98