c - Use GDateTime instead of localtime_r -


what advantage of using gdatetime instead of localtime_r in code:

char time_str[100]; time_t t; struct tm lt;  t = time(null); localtime_r(&t, &lt); strftime(time_str, 100, _("%y%m%d-%h%m%s"), &lt); 

gdatetime appears component of gnome library (glib). documented in glib, gdatetime structure (and set of methods) working date/time data, capable of representing (with microsecond precision) date/time 0001-01-01 00:00:00 9999-12-31 23:59:59.999999.

therefore, if (a) you're using glib (or willing pull in entire glib library 1 thing), and (b) need or have use increased range and/or precision provided gdatetime, then, advantage of using gdatetime instead of localtime_r have increased range and/or precision provided gdatetime.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -