time.h Questions

5

Solved

I am pretty new to Ubuntu, but I can't seem to get this to work. It works fine on my school computers and I don't know what I am not doing. I have checked usr/include and time.h is there just fine....
Caduceus asked 10/3, 2010 at 15:36

3

Solved

Consider the following C++ code #include <ctime> #include <iostream> int main() { std::time_t now = std::time(nullptr); struct tm local = *std::localtime(&now); struct tm gm = ...
Schorl asked 18/10, 2019 at 4:28

4

Solved

char* asctime (const struct tm * timeptr); char* ctime (const time_t * timer); I found that many functions inside of time.h return pointers to static variables, which could be altered by any subs...
El asked 9/7, 2019 at 11:22

1

I was trying out this function in a C program, and it keeps printing the wrong time. This is my code at the moment: #include <stdio.h> #include <unistd.h> #include <time.h> #incl...
Burst asked 10/12, 2018 at 14:48

2

Solved

I was trying out the examples in expert C programming while I encountered this problem. My program basically does one thing: use the standard gmtime function and see how many years has past since 1...
Trisect asked 27/7, 2017 at 15:46

1

I read the following manual: http://linux.die.net/man/3/clock_gettime and I wrote the following code: #include <time.h> int main() { struct timespec clk; clock_gettime(CLOCK_REALTIME, &...
Regolith asked 21/11, 2015 at 16:57

3

Solved

I'm porting over a large, old system that was known to work, onto Ubuntu 64-bit Linux. The system uses FLTK, upgrading to 1.3.2, and I'm using NetBeans. A file includes basic universal /FL/Fl.H as ...
Tingley asked 19/2, 2013 at 0:15

2

Solved

When I use the time() function (i.e., just randomize seed for rand() ) but not include the header file time.h, it works for C. For example: #include <stdio.h> #include <stdlib.h> int ...
Invention asked 16/5, 2015 at 13:1

6

Solved

Is there any way to get milliseconds and its fraction part from 1970 using time.h in c language?
Mccreery asked 23/12, 2009 at 11:40

1

Solved

I have a variable which uses time_t data type. I would like to convert this type into "YYYY-MM-DD HH:MM:SS". I only know that it works in localtime() per this example: char buff[20]; time...
Tuber asked 14/1, 2014 at 5:44

3

Solved

I am trying to implement a game using ncurses in C. I have to show the current time (the time must update each second) and my while loop looks like this while(1) { clk = time(NULL); cur_time = l...
Veron asked 29/12, 2012 at 15:2

3

Solved

What is the difference between clock_t, time_t and struct tm? struct tm looks like this: struct tm{ int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_...
Auroora asked 2/9, 2012 at 21:58

5

The time function in time.h gives milliseconds since the epoch.
Dropline asked 2/7, 2009 at 4:15

5

Solved

I started studying POSIX timers, so I started also doing some exercises, but I immediately had some problems with the compiler. When compiling this code, I get some strange messages about macros li...
Infuse asked 16/1, 2012 at 14:47

3

Solved

Possible Duplicate: How to measure time in milliseconds using ANSI C? How can I get the Windows system time with millisecond resolution? We want to calculate the time which a player ...
Flori asked 19/12, 2011 at 8:13

3

Solved

This seems like something no one should ever have to do, but I'm working on a kernel module for an embedded system (OpenWRT) in which it seems that time.h does include the timespec and time_t types...
Pollinize asked 13/8, 2009 at 22:27
1

© 2022 - 2024 — McMap. All rights reserved.