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
0
votes
3 answers

any way to run 2 loops at the same time?

I want to create a c++ program for a bank queue. Where every 3 minutes a new customer enters the queue. every customer needs 5 minutes for the service. The program print out the information after the first 30 minutes The time of arriving for each…
Sahar Alsadah
  • 2,580
  • 3
  • 19
  • 25
0
votes
0 answers

How to calculate difrence beetween two dates using ?

I was looking for similar topic here, but sadly I wasn't able to find anything helpful. Problem with my application in C++ is that I need to compute the difference in seconds between two date times given in string structure. I already cut the…
General_Code
  • 239
  • 1
  • 4
  • 12
0
votes
0 answers

strptime string time parsing error into time_t

I'm trying to fetch time value in %Y-%m-%d %H:%M:%S format from mysql and store it in time_t. I'm using two functions for that. #include #include #include #include /* convert string time stamp format to…
sandun dhammika
  • 881
  • 3
  • 12
  • 31
0
votes
1 answer

How to compare two "times" in C++ either with chrono or Ctime?

I am struggling with this problem to compare to point of times in c++ whether with "chrono" or "Ctime". I would appreciate if any one could help me with this issue.
0
votes
1 answer

Getting modification time in perl on my MAC not working

I have following code that I am using to get modification time of a file. But it is not working. Whether I use stat command or -M operator, I am getting error messages like "Use of uninitialized value…" or "Can't call method "mtime" on an undefined…
user43823
  • 43
  • 5
0
votes
3 answers

How to track total time of program?

Normally in an IDE, when you run a program the IDE will tell you the total amount of time that it took to run the program. Is there a way to get the total amount of time that it takes to run a program when using the terminal in Unix/Linux to compile…
Valrok
  • 1,514
  • 7
  • 30
  • 49
0
votes
1 answer

Checking the created time for the date and comparing to todays date?

I've not got very far with this, I'm trying to check the creation time of a file and simply compare the date (only the day, month and year) with todays date (again only day, month and year) import os.path, time import datetime fulldate =…
Ryflex
  • 5,559
  • 25
  • 79
  • 148
0
votes
1 answer

How to create arbitrary date and add days to it - c++

I am trying to write an application for an assignment and I am new to c++. A small portion of the application requires me to store a date and add an arbitrary number of days as an offset from the date. I know how I would accomplish this with Java or…
JMoore
  • 45
  • 7
0
votes
2 answers

Writing timestamps to files

I am working on a wages application. The application should allow the user to transfer an amount from an account (the account being text file "shop" which contains the value 1000). The user should be able to make as many transfers as they wish…
user3057816
  • 11
  • 2
  • 8
0
votes
2 answers

NASM: Getting the day of the week a different date

I have been tasked with writing a NASM program that gets the day of the week for the first day of the next month. As an example: If today is June 4, then the program should say something like: July 1st is a Thursday. I am using the mktime function…
Drifter64
  • 1,103
  • 3
  • 11
  • 30
0
votes
3 answers

How does the ctime function in this program work?

I am posting a program that I came across. Can anyone explain me What "0x7FFFFFFF" means? How does ctime() function work? #include #include int main() { time_t Variable = 0x7FFFFFFF; printf("Variable value is =…
kotAPI
  • 387
  • 1
  • 7
  • 20
0
votes
1 answer

How can I change my print output? (System Programming and C)

I wrote some code to display the last modified time and file names. My code compiles, but I need to change the format of the timestamp What I want is: Jul 17 12:12 2013 2-s.txt Jul 17 12:12 2013 3-s.txt What I'm getting now is: Wed Jul 17 12:24:48…
user2203774
  • 609
  • 4
  • 13
  • 25
0
votes
1 answer

error C4996: 'ctime'

I have a project about static source code analysis. The error message: "error C4996: 'ctime': This function or variable may be unsafe". Here is the part of the code where I get the error, in ctime. If someone can help me overcome this error, I…
lilya
  • 21
  • 1
  • 4
0
votes
2 answers

/ are not counting ticks

EDIT: It appears to be functioning now. The code has been updated to show my revisions. Thank you all for your help. I imagine I'm just stupid, but I'm attempting to use ctime to count CPU ticks through my entire program. I'm writing an…
smalltock
  • 5
  • 4
0
votes
0 answers

time.h / ctime issues with recording real world time

I am currently encountering an issue with the timer in my sorting algorithm, I am using a bubble sort. I require the timer to record the time when my algorithm runs where as at the moment it is taking in to consideration user time to open and enter…