Click here to Skip to main content
16,015,583 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard Andrew x6431-Oct-20 8:03
professionalRichard Andrew x6431-Oct-20 8:03 
GeneralRe: Difference between current system time and time from user input in c Pin
Mircea Neacsu31-Oct-20 8:14
Mircea Neacsu31-Oct-20 8:14 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard MacCutchan31-Oct-20 9:38
mveRichard MacCutchan31-Oct-20 9:38 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard Andrew x6431-Oct-20 10:28
professionalRichard Andrew x6431-Oct-20 10:28 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard MacCutchan31-Oct-20 21:22
mveRichard MacCutchan31-Oct-20 21:22 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard Andrew x641-Nov-20 9:58
professionalRichard Andrew x641-Nov-20 9:58 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard MacCutchan1-Nov-20 21:58
mveRichard MacCutchan1-Nov-20 21:58 
AnswerRe: Difference between current system time and time from user input in c Pin
Daniel Pfeffer31-Oct-20 11:24
professionalDaniel Pfeffer31-Oct-20 11:24 
You can use the difftime() function to subtract two time_t values. If you have the time in a struct tm, you can convert it to time_t using the mktime() function. The strftime() function formats a struct tm to text format.

These APIs are all available in C90, but some options were introduced as of C99.

difftime() should incorporate leap-seconds for past dates, but I don't know if actual implementations do so.

Note that issues such as daylight-saving time, time zones, etc. are left to the programmer. Ignoring these is a common way for programmers to shoot themselves in the foot. Smile | :)
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.

QuestionSearching and displaying a record in Array of Structure in c Pin
Member 1497910829-Oct-20 16:45
Member 1497910829-Oct-20 16:45 
AnswerRe: Searching and displaying a record in Array of Structure in c Pin
CPallini29-Oct-20 21:27
mveCPallini29-Oct-20 21:27 
QuestionHow to convert my MDI Application to open each window as a separate instance of the application Pin
manoharbalu23-Oct-20 0:09
manoharbalu23-Oct-20 0:09 
AnswerRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
trønderen23-Oct-20 0:34
trønderen23-Oct-20 0:34 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
manoharbalu23-Oct-20 0:49
manoharbalu23-Oct-20 0:49 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
trønderen23-Oct-20 8:04
trønderen23-Oct-20 8:04 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
Victor Nijegorodov23-Oct-20 8:35
Victor Nijegorodov23-Oct-20 8:35 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
trønderen23-Oct-20 9:32
trønderen23-Oct-20 9:32 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
Victor Nijegorodov23-Oct-20 10:26
Victor Nijegorodov23-Oct-20 10:26 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
manoharbalu26-Oct-20 0:07
manoharbalu26-Oct-20 0:07 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
Victor Nijegorodov26-Oct-20 0:34
Victor Nijegorodov26-Oct-20 0:34 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
manoharbalu23-Oct-20 2:35
manoharbalu23-Oct-20 2:35 
SuggestionRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
David Crow23-Oct-20 2:46
David Crow23-Oct-20 2:46 
Questionqueues to find minimum time to serve all. Pin
fecomevi21-Oct-20 22:22
fecomevi21-Oct-20 22:22 
AnswerRe: queues to find minimum time to serve all. Pin
trønderen22-Oct-20 0:04
trønderen22-Oct-20 0:04 
AnswerRe: queues to find minimum time to serve all. Pin
Richard MacCutchan22-Oct-20 0:16
mveRichard MacCutchan22-Oct-20 0:16 
QuestionRe: queues to find minimum time to serve all. Pin
David Crow22-Oct-20 3:58
David Crow22-Oct-20 3:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.