J
Jonathan
I have taken up C++ programming again and need to write a socket client,
so far I am able to create the connection to the socket.
As I need a unix timestamp in char to put on a socket in a HTTP 1.1 GET
request I am looking for a way to convert the unix timestamp to a char?
I am using the following code to generate my unix timestamp:
...
time_t mytime; /* calendar time */
mytime=time(NULL); /* get current cal time */
char chTime[10];
// Here I would like to do some conversion
strcpy (buffer, "GET /?t=" . chTime .
"HTTP/1.1\r\nHost: localhost\r\n\r\n");
write(clientSocket, buffer, sizeof(buffer) -1);
...
Any help is appreciated.
Thank in advance,
Jonathan
so far I am able to create the connection to the socket.
As I need a unix timestamp in char to put on a socket in a HTTP 1.1 GET
request I am looking for a way to convert the unix timestamp to a char?
I am using the following code to generate my unix timestamp:
...
time_t mytime; /* calendar time */
mytime=time(NULL); /* get current cal time */
char chTime[10];
// Here I would like to do some conversion
strcpy (buffer, "GET /?t=" . chTime .
"HTTP/1.1\r\nHost: localhost\r\n\r\n");
write(clientSocket, buffer, sizeof(buffer) -1);
...
Any help is appreciated.
Thank in advance,
Jonathan