Search results for 'GM Time'. 1 post(s) found.

  1. 2009/03/20 How to get GM Time as String ?
2009/03/20 09:34

How to get GM Time as String ?


Here's the simple example to get GMT string.

#include <time.h>
#include <sys/types.h>
#include <stdio.h>

int main()
{
    struct tm *mytm;

    time_t current_time = time((time_t*)NULL);
    mytm = GMTime(&current_time);
    // convert GMT to string by asctime()
    printf("%s", asctime(mytm));

    return 0;
}


Trackback 0 Comment 0

Trackback : Cannot send a trackbact to this post.