diff --git a/ChangeLog b/ChangeLog
index 6e1f6d1a3..667acf3d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-05-22 Peter Stephenson
+
+ * 38513: Matthew Martin: cast time to long long where possible.
+
2015-05-12 Clint Adams
* 38482: Completion/Debian/Command/_apt: complete available packages
diff --git a/Src/Builtins/sched.c b/Src/Builtins/sched.c
index 70625edca..835e72cb7 100644
--- a/Src/Builtins/sched.c
+++ b/Src/Builtins/sched.c
@@ -353,7 +353,11 @@ schedgetfn(UNUSED(Param pm))
time_t t;
t = sch->time;
- sprintf(tbuf, "%ld", t);
+#if defined(PRINTF_HAS_LLD)
+ sprintf(tbuf, "%lld", (long long)t);
+#else
+ sprintf(tbuf, "%ld", (long)t);
+#endif
if (sch->flags & SCHEDFLAG_TRASH_ZLE)
flagstr = "-o";
else