Questions tagged [ctime]

CTime Class The upper date limit is 12/31/3000. The lower limit is 1/1/1970 12:00:00 AM GMT.

CTime does not have a base class.

CTime values are based on coordinated universal time (UTC), which is equivalent to Greenwich mean time (GMT). The local time zone is controlled by the TZ environment variable.

When creating a CTime object, set the nDST parameter to 0 to indicate that standard time is in effect, or to a value greater than 0 to indicate that daylight savings time is in effect, or to a value less than zero to have the C run-time library code compute whether standard time or daylight savings time is in effect. tm_isdst is a required field. If not set, its value is undefined and the return value from mktime is unpredictable. If timeptr points to a tm structure returned by a previous call to asctime, gmtime, or localtime, the tm_isdst field contains the correct value.

A companion class, CTimeSpan, represents a time interval.

The CTime and CTimeSpan classes are not designed for derivation. Because there are no virtual functions, the size of CTime and CTimeSpan objects is exactly 8 bytes. Most member functions are inline.

252 questions
-1
votes
1 answer

Convert ctime() to Time::tm

I have a perl method that is using Time::tm values and I'd like to compare a file time. Using File::stat to get the file ctime (ctime(stat($file)->mtime)) returns a scalar value that is a human-readable format. Is there a way to return or convert…
McArthey
  • 1,614
  • 30
  • 62
-2
votes
2 answers

C++ program error: malloc(): memory corruption

C++ newbie and have been writing a C++ program, but it finally breaks at the point of calling a lib function call from ctime. The error shows info like this: malloc(): memory corruption AFAIK, this error(memory corruption) should be resulted from…
leonyuuu
  • 11
  • 7
-2
votes
2 answers

c++ getting current time in my constructor

This is my question: (Enhancing Class Time) Provide a constructor that’s capable of using the current time from the time and localtime functions—declared in the C++ Standard Library header —to initialize an object of the Time class. Here's my…
-2
votes
2 answers

How to get ctime in java?

I want to get ctime of a file in java. ctime is change time ,can be get by using "ls -lc filename" in linux. but how can I get it in java ? also I need to get it in java's FTP API.
Geek2Sages
  • 67
  • 2
  • 7
-2
votes
2 answers

Converting 13 decimals to datetime

I have a project about cars with GPS. I need to return the start and the finish moment for each car. So we have: time_t x, y; Because I will use later them for a transformation. I have a problem. I read from an external file data in this…
-2
votes
3 answers

How can I get current date in c++?

I did not find any solution which give the only date. I found the solution but all are complex and we have to parse the array and separate the date from time
sss
  • 31
  • 1
  • 2
-3
votes
1 answer

Why does the compiler not recognize some of the functions of a library?

Why does the compiler not recognize some of the functions of a library? I have enclosed the library in Qt but does not recognize its functions. why? and how can I solve my problem?
Pasha
  • 73
  • 1
  • 2
-3
votes
1 answer

rand() only sets variable to 0

I am working on a rock, paper, scissors game and one of the ways I am setting the computer's choice is through rand(). I #include , seed rand at the start of main with srand(time(0)); and I call it in a function definition with…
njwoodard
  • 37
  • 1
  • 5
-3
votes
1 answer

how to display system current time + 3 minutes?

In c++: How can I display the system current time (only time without the date) ? How can I display current time + 3 minutes? Can I do it using cout? Which libraries or functions to use ?
Sahar Alsadah
  • 2,580
  • 3
  • 19
  • 25
-3
votes
1 answer

c++ program (Matrix and functions)

help me please!i need to do a program that prints a 6x6 matrix of 0's and 1's randomly. The hardest part is that the program must show the road between (0,0) and (5,5) moving on left, right, up and down, showing every cordinate. If there is no road,…
-4
votes
2 answers

Strftime issue in class or function

i write this code on main, it's just work fine but when i try to put this in function or class method, it's does not work, why? also when i debug this code, it's seems like not compiling time_t and struct tmp. const char* getFormat() { …
mstfyvtrl
  • 19
  • 4
-4
votes
1 answer

Saving new points in time with ctime overwrites the old strings?

Preface: I've been learning C this past summer and only recently started learning C++ so I don't know very much of it yet. I've been trying to write a C/C++ program that recognizes right and left mouse clicks in windows and saves which button was…
1 2 3
16
17