diff --git a/src/common/macros.h b/src/common/macros.h
index 6fa9a29ebe1d30b4fef4d5174368af404297b5f4..8d392dc6da89495338d9b92aac15917a58ddbac0 100644
--- a/src/common/macros.h
+++ b/src/common/macros.h
@@ -245,6 +245,9 @@ typedef enum {false, true} bool;
 
 #endif /* WITH_PTHREADS */
 
+#define slurm_atoul(str) strtoul(str, NULL, 10)
+#define slurm_atoull(str) strtoull(str, NULL, 10)
+
 #ifndef strong_alias
 #  if USE_ALIAS
 #    define strong_alias(name, aliasname) \
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c b/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c
index 4b2268947bf6e12ae1ff5e4a56ee0cda057dcf11..d5afc6b75bfec4d9442951ea8f7a95dba0d3ab4e 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c
@@ -495,7 +495,7 @@ static int _cluster_get_jobs(mysql_conn_t *mysql_conn,
 		job->submit = submit;
 		job->start = atoi(row[JOB_REQ_START]);
 		job->end = atoi(row[JOB_REQ_END]);
-		job->timelimit = atoi(row[JOB_REQ_TIMELIMIT]);
+		job->timelimit = slurm_atoul(row[JOB_REQ_TIMELIMIT]);
 
 		/* since the job->end could be set later end it here */
 		if(job->end) {