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
1 answer

Why do 2 time structs with the same date and time return false when compared with ==?

I have a time.Time created using time.Date(). I then calculate the number of nanoseconds between 1970/1/1 00:00:00.000000000 and that time. I then take the nanoseconds and turn them back into a time.Time using time.Unix(). However, if I compare the…
F21
  • 32,163
  • 26
  • 99
  • 170
8
votes
2 answers

C++ time_t problem

I'm having trouble with dates management in C++ (VS 2008). According to MSDN specifications, time_t represents: The number of seconds since January 1, 1970, 0:00 UTC therefore, I've written this piece of code: #include #include…
digEmAll
  • 56,430
  • 9
  • 115
  • 140
8
votes
2 answers

How to set time to dd-MMM-yyyy HH:mm:ss in go?

https://play.golang.org/p/82QgBdoI2G package main import "fmt" import "time" func main() { fmt.Println(time.Now().Format("01-JAN-2006 15:04:00")) } The output should be like if date time today is 2016-03-03 08:00:00 +0000UTC Output:…
user5160937
8
votes
0 answers

time command shows user time greater than real time

I have more or less the same question as linux time command resulting real is less than user and user time larger than real time but can't post a comment on those questions. When I run the non-multi-threaded program given below, I occasionally get…
8
votes
2 answers

Modify scale of Datadog metric

I have a time series presenting time values like this one: I want to change the y-axis to represent hours instead of milliseconds, i.e. divide by 3600. Any idea how to do it?
tashuhka
  • 5,028
  • 4
  • 45
  • 64
8
votes
3 answers

Checking when a date has passed - Swift

Well, the title pretty much says it all. What I am trying to do is check when a date has passed. So, for example let us say that a user is using my app and then they go to bed and check my app in the morning. When my app opens up I need to check if…
Harish
  • 1,374
  • 17
  • 39
8
votes
3 answers

Getting Current Date Time for a Random Number Generator's Seed

Preferably as a long. All the example I can find are getting the date/time as a string and not any scalar value. :)
bobber205
  • 12,948
  • 27
  • 74
  • 100
8
votes
4 answers

Why does Time.now.today? return false in my Rails 4 application?

It is 8:04PM in the Eastern Standard Time Zone (US) on February 5, 2016. When I run this command Time.now.today? #=> false it returns false. Why, and how can I correct it? Thanks. Details: Rails 4.0.0 Ruby 2.2.1p85 Mac OS X El Capitan
boulder_ruby
  • 38,457
  • 9
  • 79
  • 100
8
votes
2 answers

Converting a formatted time string to milliseconds

I am trying to convert '2015-09-15T17:13:29.380Z' to milliseconds. At first I used: time.mktime( datetime.datetime.strptime( "2015-09-15T17:13:29.380Z", "%Y-%m-%dT%H:%M:%S.%fZ" ).timetuple() ) I got 1442330009.0 - with no microseconds. …
Karl Stulik
  • 961
  • 1
  • 12
  • 24
8
votes
7 answers

How to get time in Indian Time zone?

For You tube API we are setting start Schedule time and End time In "2015-08-28T00:00:00.000Z" This format the Z- is representing the zulu (GMT-7) time zone. I need to pass the time with Indian time zone code (GMT+5:30). What's the code I need to…
Kichu
  • 1,641
  • 4
  • 21
  • 28
8
votes
3 answers

Capturing the executing time between 2 statements Java?

I want to capture the time take to go from statement A to Statement B in a Java class. In between these statements there are many web service calls made. I wanted to know if there is some stop watch like functionality in java that i could use to…
Kaddy
  • 1,226
  • 7
  • 21
  • 34
8
votes
4 answers

data difference in `as.POSIXct` with Excel

My actual data looks like: 8/8/2013 15:10 7/26/2013 10:30 7/11/2013 14:20 3/28/2013 16:15 3/18/2013 15:50 When I read this from the excel file, R reads it as: 41494.63 41481.44 41466.60 41361.68 41351.66 So I used…
Kavipriya
  • 441
  • 4
  • 17
8
votes
3 answers

Add time to datetime

I have a date string like this and then use strptime() So its like this my_time = datetime.datetime.strptime('07/05/15', '%m/%d/%Y') and now I want to add 23 hours and 59 minutes to my_time I have tried .timedelta but it doesn't work? How could I…
spen123
  • 3,464
  • 11
  • 39
  • 52
8
votes
4 answers

Print NominalDiffTime as hours, minutes and seconds

I'm surprised nobody has asked this before, but... How do I trivially print a NominalDiffTime as hours, minutes and seconds? (And possibly days, if it happens to be that long...) For reasons unknown, the Show instance prints total seconds, which is…
MathematicalOrchid
  • 61,854
  • 19
  • 123
  • 220
8
votes
1 answer

Running time of Kruskal's algorithm

The Kruskal's algorithm is the following: MST-KRUSKAL(G,w) 1. A={} 2. for each vertex v∈ G.V 3. MAKE-SET(v) 4. sort the edges of G.E into nondecreasing order by weight w 5. for each edge (u,v) ∈ G.E, taken in nondecreasing order by weight w 6. …
Mary Star
  • 375
  • 7
  • 27
1 2 3
99
100