I was wondering if anyone could give me an example of some source code that could give the time in the form of HH.MM
i know it can be done as follows but i need it in the above format so i can search an array for that time.
the problem with this is that it out puts the time in the format
www MMM dd hh:mm:ss yyyy
where w is the weekday
M is the month in letters
d is the date in the month
h is the hour
m is the minute
s is the second
y is the year
could i make a string by taking the hour.minute and comparing them against the times (the times in the array ar in teh format 7.56, 17.38 etc)
thanks,
nnp
i know it can be done as follows but i need it in the above format so i can search an array for that time.
Code:
#include <iostream>
#include <time.h>
#include <string.h>
main()
{
char currenttime[26];
time_t t;
time(&t);
strcpy(currenttime, ctime(&t));
}
www MMM dd hh:mm:ss yyyy
where w is the weekday
M is the month in letters
d is the date in the month
h is the hour
m is the minute
s is the second
y is the year
could i make a string by taking the hour.minute and comparing them against the times (the times in the array ar in teh format 7.56, 17.38 etc)
thanks,
nnp