-#ifndef HAVE_GMTIME_R
- ldap_pvt_thread_mutex_lock( &gmtime_mutex );
- tms = gmtime( &starttime );
-#else /* HAVE_GMTIME_R */
- tms = gmtime_r( &starttime, &tm_buf );
-#endif /* HAVE_GMTIME_R */
- lutil_gentime( tmbuf, sizeof(tmbuf), tms );
-#ifndef HAVE_GMTIME_R
- ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
-#endif
+ timestamp.bv_val = tmbuf;
+ timestamp.bv_len = sizeof(tmbuf);
+ slap_timestamp( &starttime, ×tamp );