patch 8.1.1313: warnings for using localtime() and ctime()

Problem:    Warnings for using localtime() and ctime().
Solution:   Use localtime_r() if available.  Avoid using ctime().
diff --git a/src/hardcopy.c b/src/hardcopy.c
index 1ceed99..a3b1c0e 100644
--- a/src/hardcopy.c
+++ b/src/hardcopy.c
@@ -2723,9 +2723,7 @@
     int
 mch_print_begin(prt_settings_T *psettings)
 {
-    time_t	now;
     int		bbox[4];
-    char	*p_time;
     double      left;
     double      right;
     double      top;
@@ -2734,7 +2732,6 @@
     struct prt_ps_resource_S *res_encoding;
     char	buffer[256];
     char_u      *p_encoding;
-    char_u	*p;
     struct prt_ps_resource_S *res_cidfont;
     struct prt_ps_resource_S *res_cmap;
     int		retval = FALSE;
@@ -2761,13 +2758,8 @@
     prt_dsc_textline("For", buffer);
     prt_dsc_textline("Creator", VIM_VERSION_LONG);
     /* Note: to ensure Clean8bit I don't think we can use LC_TIME */
-    now = time(NULL);
-    p_time = ctime(&now);
-    /* Note: ctime() adds a \n so we have to remove it :-( */
-    p = vim_strchr((char_u *)p_time, '\n');
-    if (p != NULL)
-	*p = NUL;
-    prt_dsc_textline("CreationDate", p_time);
+
+    prt_dsc_textline("CreationDate", get_ctime(time(NULL), FALSE));
     prt_dsc_textline("DocumentData", "Clean8Bit");
     prt_dsc_textline("Orientation", "Portrait");
     prt_dsc_atend("Pages");