diff --git a/servers/slapd/add.c b/servers/slapd/add.c
index 93cc3cdcd3b3c74e7eab51c8c35d54632fc5bb19..ec233cd6a56a012e3dd7b0d3909f4b92578d7f1e 100644
--- a/servers/slapd/add.c
+++ b/servers/slapd/add.c
@@ -184,10 +184,11 @@ add_created_attrs( Operation *op, Entry *e )
 	attr_merge( e, "creatorsname", bvals );
 
 	pthread_mutex_lock( &currenttime_mutex );
-	ltm = localtime( &currenttime );
 #ifdef LDAP_Y2K
+	ltm = gmtime( &currenttime );
 	strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
 #else
+	ltm = localtime( &currenttime );
 	strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
 #endif
 	pthread_mutex_unlock( &currenttime_mutex );
diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c
index dd7689cfaf9bc23f031ea5607917c4211d62fe6e..ff6d4dd0470b9851c79544932ad82e0f9636b135 100644
--- a/servers/slapd/modify.c
+++ b/servers/slapd/modify.c
@@ -251,10 +251,11 @@ add_lastmods( Operation *op, LDAPMod **mods )
 	*mods = tmp;
 
 	pthread_mutex_lock( &currenttime_mutex );
-	ltm = localtime( &currenttime );
 #ifdef LDAP_Y2K
+	ltm = gmtime( &currenttime );
 	strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
 #else
+	ltm = localtime( &currenttime );
 	strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
 #endif
 	pthread_mutex_unlock( &currenttime_mutex );
diff --git a/servers/slapd/monitor.c b/servers/slapd/monitor.c
index a7311989ef4fb086ed8541a5d238e74307f941cc..6a3403ea926f561092ce232791d6e5c5ee7e99af 100644
--- a/servers/slapd/monitor.c
+++ b/servers/slapd/monitor.c
@@ -93,10 +93,11 @@ monitor_info( Connection *conn, Operation *op )
 				nreadwaiters++;
 			}
 			pthread_mutex_lock( &currenttime_mutex );
-			ltm = localtime( &c[i].c_starttime );
 #ifdef LDAP_Y2K
+			ltm = gmtime( &c[i].c_starttime );
 			strftime( buf2, sizeof(buf2), "%Y%m%d%H%M%SZ", ltm );
 #else
+			ltm = localtime( &c[i].c_starttime );
 			strftime( buf2, sizeof(buf2), "%y%m%d%H%M%SZ", ltm );
 #endif
 			pthread_mutex_unlock( &currenttime_mutex );