libbb: introduce and use strftime_[YYYYMMDD]HHMMSS()
[oweals/busybox.git] / networking / ntpd.c
index 79b7c379361f615c1ab49d106cdec283b527385e..0f4319ef206611d287e629ff80fb848bcf1ab459 100644 (file)
@@ -887,11 +887,11 @@ step_time(double offset)
 
        VERB2 {
                tval = tvc.tv_sec;
-               strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", localtime(&tval));
+               strftime_YYYYMMDDHHMMSS(buf, sizeof(buf), &tval);
                bb_error_msg("current time is %s.%06u", buf, (unsigned)tvc.tv_usec);
        }
        tval = tvn.tv_sec;
-       strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", localtime(&tval));
+       strftime_YYYYMMDDHHMMSS(buf, sizeof(buf), &tval);
        bb_error_msg("setting time to %s.%06u (offset %+fs)", buf, (unsigned)tvn.tv_usec, offset);
 
        /* Correct various fields which contain time-relative values: */