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, <); strftime(time_str, 100, _("%y%m%d-%h%m%s"), <);
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
Post a Comment