ricedragon
ricedragon

Reputation: 173

time.h library default functions C++

i was wonder if the localtime() function work on Linux? i though there is another command for that but i cant remember it now

apparently my assignment have to work on linux or it doesn't count for marks and my parents does not know how to use it

Upvotes: 0

Views: 701

Answers (2)

Edward Black
Edward Black

Reputation: 250

According to this localtime() should work perfectly fine with Linux.

From the linked:

    #include <time.h>
    //...
    struct tm *localtime(const time_t *timep);
    struct tm *localtime_r(const time_t *timep, struct tm *result);

If that declaration is the same localtime() that you're asking about (and I assume it is) then you should be just fine using it on Linux based machines.

Upvotes: 3

Alok Save
Alok Save

Reputation: 206566

Yes localtime() function works on Linux. Check the reference here.

Upvotes: 1

Related Questions