[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 09/10: herd: Use 'strftime' rather than 'date->string' for 's
From: |
Ludovic Courtès |
Subject: |
[shepherd] 09/10: herd: Use 'strftime' rather than 'date->string' for 'status' output. |
Date: |
Thu, 27 Apr 2023 10:16:36 -0400 (EDT) |
civodul pushed a commit to branch master
in repository shepherd.
commit b05c51a6251b0982933d0598191f15fb733e135f
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Apr 27 16:05:37 2023 +0200
herd: Use 'strftime' rather than 'date->string' for 'status' output.
* modules/shepherd/scripts/herd.scm (time->string)[absolute]: Use
'strftime' instead of 'date->string'.
---
modules/shepherd/scripts/herd.scm | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/modules/shepherd/scripts/herd.scm
b/modules/shepherd/scripts/herd.scm
index 983c7b4..624b612 100644
--- a/modules/shepherd/scripts/herd.scm
+++ b/modules/shepherd/scripts/herd.scm
@@ -173,13 +173,15 @@ into a @code{live-service} record."
(let* ((time (make-time time-utc 0 time))
(date (time-utc->date time))
(year (date-year date))
- (now (time-utc->date now*))
- (format (if (= year (date-year now))
- (if (= (date-day date) (date-day now))
- "~H:~M:~S"
- "~e ~b ~H:~M:~S")
- "~e ~b ~Y ~H:~M:~S")))
- (date->string date format)))
+ (now* (time-utc->date now*))
+ ;; Note: Use 'strftime' rather than 'date->string' to better
+ ;; account for locale preferences.
+ (format (if (= year (date-year now*))
+ (if (= (date-day date) (date-day now*))
+ "%X"
+ "%c")
+ "%c")))
+ (strftime format (localtime now))))
;; TRANSLATORS: The first placeholder is for a date string such as "April 22
;; 19:07:46" and the parenthesized placeholder is for the corresponding
- [shepherd] branch master updated (69f93a6 -> b79b9a3), Ludovic Courtès, 2023/04/27
- [shepherd] 04/10: doc: Clarify upfront what the config file does., Ludovic Courtès, 2023/04/27
- [shepherd] 02/10: service: 'register-services' now takes a list of services., Ludovic Courtès, 2023/04/27
- [shepherd] 03/10: tests: Update for new 'register-services' interface., Ludovic Courtès, 2023/04/27
- [shepherd] 07/10: service: 'shutdown-services' does not stop 'root'., Ludovic Courtès, 2023/04/27
- [shepherd] 01/10: service: Rename 'make-actions' to 'actions'., Ludovic Courtès, 2023/04/27
- [shepherd] 05/10: doc: Update user services example., Ludovic Courtès, 2023/04/27
- [shepherd] 06/10: herd: Add 'graph' action., Ludovic Courtès, 2023/04/27
- [shepherd] 08/10: service: Localize help message of the 'root' service., Ludovic Courtès, 2023/04/27
- [shepherd] 10/10: repl: Update calls to deprecated 'start'., Ludovic Courtès, 2023/04/27
- [shepherd] 09/10: herd: Use 'strftime' rather than 'date->string' for 'status' output.,
Ludovic Courtès <=