Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #264851 > unrolled thread

difference in seconds between two formatted dates ...

Started byAlbretch Mueller <lbrtchx@gmail.com>
First post2023-12-17 11:20 +0100
Last post2023-12-17 15:10 +0100
Articles 6 on this page of 166 — 34 participants

Back to article view | Back to linux.debian.user


Contents

  difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-17 11:20 +0100
    Re: difference in seconds between two formatted dates ... Andy Smith <andy@strugglers.net> - 2023-12-17 12:00 +0100
      Re: difference in seconds between two formatted dates ... <tomas@tuxteam.de> - 2023-12-17 12:10 +0100
        Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-17 16:30 +0100
          Re: difference in seconds between two formatted dates ... "Andrew M.A. Cater" <amacater@einval.com> - 2023-12-17 17:00 +0100
          Re: difference in seconds between two formatted dates ... <tomas@tuxteam.de> - 2023-12-17 17:10 +0100
          Re: difference in seconds between two formatted dates ... Andy Smith <andy@strugglers.net> - 2023-12-17 17:40 +0100
            Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-17 23:50 +0100
            Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-18 00:10 +0100
              Re: difference in seconds between two formatted dates ... David Wright <deblis@lionunicorn.co.uk> - 2023-12-18 01:40 +0100
                Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-18 02:20 +0100
                  Re: difference in seconds between two formatted dates ... David Wright <deblis@lionunicorn.co.uk> - 2023-12-18 07:00 +0100
                    Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-18 07:10 +0100
                      Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-18 13:20 +0100
                        Re: difference in seconds between two formatted dates ... <tomas@tuxteam.de> - 2023-12-18 14:10 +0100
                          Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-18 14:20 +0100
                            date can't parse its own output was: difference in seconds between  two formatted dates ...) <tomas@tuxteam.de> - 2023-12-18 14:40 +0100
                      Re: difference in seconds between two formatted dates ... David Wright <deblis@lionunicorn.co.uk> - 2023-12-18 19:40 +0100
                        Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-18 20:20 +0100
                          Re: difference in seconds between two formatted dates ... David Wright <deblis@lionunicorn.co.uk> - 2023-12-20 07:10 +0100
                            Re: difference in seconds between two formatted dates ... <tomas@tuxteam.de> - 2023-12-20 08:40 +0100
                              Re: difference in seconds between two formatted dates ... David Wright <deblis@lionunicorn.co.uk> - 2023-12-21 06:00 +0100
                                Re: difference in seconds between two formatted dates ... <tomas@tuxteam.de> - 2023-12-21 06:40 +0100
                                  Re: difference in seconds between two formatted dates ... David Wright <deblis@lionunicorn.co.uk> - 2023-12-22 02:30 +0100
                                Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-21 13:20 +0100
                                  RTC and (old) Windows [was: difference in seconds between two  formatted dates ...] <tomas@tuxteam.de> - 2023-12-21 13:30 +0100
                                    Re: RTC and (old) Windows [was: difference in seconds between two  formatted dates ...] David Christensen <dpchrist@holgerdanske.com> - 2023-12-21 23:30 +0100
                                  Re: difference in seconds between two formatted dates ... David Wright <deblis@lionunicorn.co.uk> - 2023-12-22 02:40 +0100
                                    Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-22 04:10 +0100
                            Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-20 08:50 +0100
                              Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-20 13:20 +0100
                                Re: difference in seconds between two formatted dates ... <tomas@tuxteam.de> - 2023-12-20 13:40 +0100
                                  Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-20 14:20 +0100
                                    Re: difference in seconds between two formatted dates ... <tomas@tuxteam.de> - 2023-12-20 14:40 +0100
                                    Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-20 16:10 +0100
                                      Re: difference in seconds between two formatted dates ... Nicolas George <george@nsup.org> - 2023-12-20 16:30 +0100
                                      systemd and timezone (was: Re: difference in seconds between two  formatted dates ...) Max Nikulin <manikulin@gmail.com> - 2023-12-21 04:50 +0100
                                        Re: systemd and timezone (was: Re: difference in seconds between two  formatted dates ...) <tomas@tuxteam.de> - 2023-12-21 07:00 +0100
                                          Re: systemd and timezone Max Nikulin <manikulin@gmail.com> - 2023-12-21 17:10 +0100
                                            Re: systemd and timezone Nicholas Geovanis <nickgeovanis@gmail.com> - 2023-12-22 02:00 +0100
                                              Re: systemd and timezone Andy Smith <andy@strugglers.net> - 2023-12-22 13:50 +0100
                                          Re: systemd and timezone (was: Re: difference in seconds between two  formatted dates ...) Jeffrey Walton <noloader@gmail.com> - 2023-12-21 17:30 +0100
                                            Re: systemd and timezone (was: Re: difference in seconds between two  formatted dates ...) tomas@tuxteam.de - 2023-12-21 18:40 +0100
                                        Re: systemd and timezone (was: Re: difference in seconds between two  formatted dates ...) Dan Ritter <dsr@randomstring.org> - 2023-12-21 15:30 +0100
                                          Re: systemd and timezone (was: Re: difference in seconds between two  formatted dates ...) <tomas@tuxteam.de> - 2023-12-21 16:10 +0100
                                            Re: systemd and timezone (was: Re: difference in seconds between two  formatted dates ...) Nicolas George <george@nsup.org> - 2023-12-21 23:00 +0100
                                              Re: systemd and timezone gene heskett <gheskett@shentel.net> - 2023-12-22 01:00 +0100
                                            Re: systemd and timezone Max Nikulin <manikulin@gmail.com> - 2023-12-22 13:50 +0100
                                              Re: systemd and timezone <tomas@tuxteam.de> - 2023-12-22 14:40 +0100
                                                Re: systemd and timezone Greg Wooledge <greg@wooledge.org> - 2023-12-22 15:20 +0100
                                                  Re: systemd and timezone David Wright <deblis@lionunicorn.co.uk> - 2023-12-22 16:50 +0100
                                                    Re: systemd and timezone Greg Wooledge <greg@wooledge.org> - 2023-12-22 17:30 +0100
                                                      Re: systemd and timezone "Arno Lehmann, ITS" <al@its-lehmann.de> - 2023-12-22 20:20 +0100
                                                        Re: systemd and timezone Greg Wooledge <greg@wooledge.org> - 2023-12-22 21:00 +0100
                                                      Re: systemd and timezone David Wright <deblis@lionunicorn.co.uk> - 2023-12-22 20:50 +0100
                                                        Re: systemd and timezone Greg Wooledge <greg@wooledge.org> - 2023-12-22 21:20 +0100
                                                          Re: systemd and timezone David Wright <deblis@lionunicorn.co.uk> - 2023-12-23 07:20 +0100
                                                      Re: systemd and timezone Sven Joachim <svenjoac@gmx.de> - 2023-12-22 21:20 +0100
                                                        Re: systemd and timezone Greg Wooledge <greg@wooledge.org> - 2023-12-22 22:40 +0100
                                                          Re: systemd and timezone David Wright <deblis@lionunicorn.co.uk> - 2023-12-23 00:30 +0100
                                                            Re: systemd and timezone Pocket <pocket@columbus.rr.com> - 2023-12-23 00:50 +0100
                                                            Re: systemd and timezone Pocket <pocket@columbus.rr.com> - 2023-12-23 01:10 +0100
                                                              Re: systemd and timezone David Wright <deblis@lionunicorn.co.uk> - 2023-12-23 07:20 +0100
                                                                Re: Support for SysV service scripts deprecated in systemd 255 (was:  systemd and timezone) Felix Miata <mrmazda@earthlink.net> - 2023-12-23 08:10 +0100
                                                                Re: systemd and timezone Pocket <pocket@columbus.rr.com> - 2023-12-23 12:10 +0100
                                                          Re: systemd and timezone Nate Bargmann <n0nb@n0nb.us> - 2023-12-23 02:00 +0100
                                                            Re: systemd and timezone Greg Wooledge <greg@wooledge.org> - 2023-12-23 02:20 +0100
                                                  Re: systemd and timezone <tomas@tuxteam.de> - 2023-12-22 17:10 +0100
                                                Re: systemd and timezone Jeffrey Walton <noloader@gmail.com> - 2023-12-22 21:00 +0100
                                                  Re: systemd and timezone Nicolas George <george@nsup.org> - 2023-12-22 23:40 +0100
                                                    Re: systemd and timezone Charles Kroeger <mbone@gmx.co.uk> - 2024-01-06 03:30 +0100
                                                      Re: systemd and timezone Greg Wooledge <greg@wooledge.org> - 2024-01-06 05:30 +0100
                                                        Re: systemd and timezone gene heskett <gheskett@shentel.net> - 2024-01-06 06:40 +0100
                                                          tzdata-legacy [was: Re: systemd and timezone] Max Nikulin <manikulin@gmail.com> - 2024-01-06 07:20 +0100
                                                            Re: tzdata-legacy [was: Re: systemd and timezone] Max Nikulin <manikulin@gmail.com> - 2024-01-06 08:10 +0100
                                                              Re: tzdata-legacy [was: Re: systemd and timezone] Nate Bargmann <n0nb@n0nb.us> - 2024-01-06 10:20 +0100
                                                                Re: tzdata-legacy [was: Re: systemd and timezone] gene heskett <gheskett@shentel.net> - 2024-01-06 13:10 +0100
                                                                Re: tzdata-legacy [was: Re: systemd and timezone] Greg Wooledge <greg@wooledge.org> - 2024-01-06 16:10 +0100
                                                                Re: tzdata-legacy [was: Re: systemd and timezone] David Wright <deblis@lionunicorn.co.uk> - 2024-01-07 18:30 +0100
                                                            was: Re: tzdata-legacy [was: Re: systemd and timezone] gene heskett <gheskett@shentel.net> - 2024-01-06 13:00 +0100
                                                              Re: was: Re: tzdata-legacy [was: Re: systemd and timezone] John Hasler <john@sugarbit.com> - 2024-01-06 15:30 +0100
                                                                SOLVED FOR GENE:Re: was: Re: tzdata-legacy [was: Re: systemd and  timezone] gene heskett <gheskett@shentel.net> - 2024-01-06 20:10 +0100
                                                                  Re: SOLVED FOR GENE:Re: was: Re: tzdata-legacy [was: Re: systemd  and timezone] John Hasler <john@sugarbit.com> - 2024-01-06 20:40 +0100
                                                                    Re: SOLVED FOR GENE:Re: was: Re: tzdata-legacy [was: Re: systemdand  timezone] gene heskett <gheskett@shentel.net> - 2024-01-06 21:40 +0100
                                                                      Re: SOLVED FOR GENE:Re: was: Re: tzdata-legacy [was: Re: systemdand  timezone] Nate Bargmann <n0nb@n0nb.us> - 2024-01-06 23:10 +0100
                                                                        Re: SOLVED FOR GENE:Re: was: Re: tzdata-legacy [was: Re: systemdand  timezone] Greg Wooledge <greg@wooledge.org> - 2024-01-07 01:10 +0100
                                                                        Re: SOLVED FOR GENE:Re: was: Re: tzdata-legacy [was: Re:  systemdandtimezone] gene heskett <gheskett@shentel.net> - 2024-01-07 05:30 +0100
                                                                          Re: SOLVED FOR GENE:Re: was: Re: tzdata-legacy [was: Re:  systemdandtimezone] Nate Bargmann <n0nb@n0nb.us> - 2024-01-07 12:30 +0100
                                                                            Re: SOLVED FOR GENE Felix Miata <mrmazda@earthlink.net> - 2024-01-07 12:40 +0100
                                                                              Re: SOLVED FOR GENE jeremy ardley <jeremy.ardley@gmail.com> - 2024-01-07 13:10 +0100
                                                                                Re: SOLVED FOR GENE john doe <johndoe65534@mail.com> - 2024-01-07 13:40 +0100
                                                                              Re: SOLVED FOR GENE Michael Stone <mstone@debian.org> - 2024-01-11 14:30 +0100
                                                                                Re: SOLVED FOR GENE Felix Miata <mrmazda@earthlink.net> - 2024-01-11 18:10 +0100
                                                                    manpages package [WAS Re: SOLVED FOR GENE:Re: was: Re: tzdata-legacy  [was: Re: systemd and timezone] "Andrew M.A. Cater" <amacater@einval.com> - 2024-01-06 23:50 +0100
                                                              Re: was: Re: tzdata-legacy [was: Re: systemd and timezone] Max Nikulin <manikulin@gmail.com> - 2024-01-06 18:10 +0100
                                                                Re: was: Re: tzdata-legacy [was: Re: systemd and timezone] gene heskett <gheskett@shentel.net> - 2024-01-06 20:40 +0100
                                                                  systemd-timesyncd Max Nikulin <manikulin@gmail.com> - 2024-01-07 16:50 +0100
                                                                    Re: systemd-timesyncd John Hasler <john@sugarbit.com> - 2024-01-07 17:30 +0100
                                                                      Re: systemd-timesyncd gene heskett <gheskett@shentel.net> - 2024-01-07 21:20 +0100
                                                                      Re: systemd-timesyncd Charles Kroeger <mbone@gmx.co.uk> - 2024-01-08 06:50 +0100
                                                                    Re: systemd-timesyncd gene heskett <gheskett@shentel.net> - 2024-01-07 21:10 +0100
                                                                      Re: systemd-timesyncd "Andrew M.A. Cater" <amacater@einval.com> - 2024-01-07 22:00 +0100
                                                                        Re: systemd-timesyncd Charles Curley <charlescurley@charlescurley.com> - 2024-01-08 00:00 +0100
                                                                          Re: systemd-timesyncd Nicholas Geovanis <nickgeovanis@gmail.com> - 2024-01-08 01:40 +0100
                                                                            VAX emulation/simulation (was Re: systemd-timesyncd) The Wanderer <wanderer@fastmail.fm> - 2024-01-08 02:10 +0100
                                                                              Re: VAX emulation/simulation (was Re: systemd-timesyncd) Bret Busby <bret@busby.net> - 2024-01-08 10:40 +0100
                                                                                Re: VAX emulation/simulation (was Re: systemd-timesyncd) "Jeremy Nicoll" <jn.ml.dbi.73@letterboxes.org> - 2024-01-08 11:40 +0100
                                                                                  Re: VAX emulation/simulation (was Re: systemd-timesyncd) "Thomas Schmitt" <scdbackup@gmx.net> - 2024-01-08 13:20 +0100
                                                                                    Re: VAX emulation/simulation (was Re: systemd-timesyncd) Nicholas Geovanis <nickgeovanis@gmail.com> - 2024-01-09 01:00 +0100
                                                                                      Re: VAX emulation/simulation (was Re: systemd-timesyncd) "Thomas Schmitt" <scdbackup@gmx.net> - 2024-01-09 09:20 +0100
                                                                                        Re: VAX emulation/simulation (was Re: systemd-timesyncd) Bret Busby <bret@busby.net> - 2024-01-09 10:40 +0100
                                                                                          Re: VAX emulation/simulation (was Re: systemd-timesyncd) "Thomas Schmitt" <scdbackup@gmx.net> - 2024-01-09 11:20 +0100
                                                                                          Re: VAX emulation/simulation (was Re: systemd-timesyncd) Nicolas George <george@nsup.org> - 2024-01-09 11:40 +0100
                                                                                        Re: VAX emulation/simulation (was Re: systemd-timesyncd) gene heskett <gheskett@shentel.net> - 2024-01-09 12:30 +0100
                                                                                Re: VAX emulation/simulation (was Re: systemd-timesyncd) "Niall O'Reilly" <niall+lists@no8.be> - 2024-01-08 21:50 +0100
                                                                            Re: systemd-timesyncd gene heskett <gheskett@shentel.net> - 2024-01-08 16:00 +0100
                                                                          Re: systemd-timesyncd gene heskett <gheskett@shentel.net> - 2024-01-08 16:00 +0100
                                                                        Re: systemd-timesyncd Max Nikulin <manikulin@gmail.com> - 2024-01-08 04:40 +0100
                                                                        Re: systemd-timesyncd Curt <curty@free.fr> - 2024-01-08 18:00 +0100
                                                                      Re: systemd-timesyncd Max Nikulin <manikulin@gmail.com> - 2024-01-08 04:20 +0100
                                                                        Re: systemd-timesyncd Charles Curley <charlescurley@charlescurley.com> - 2024-01-08 05:10 +0100
                                                                      Re: systemd-timesyncd Mark Fletcher <mark27q1@gmail.com> - 2024-01-08 14:50 +0100
                                                  mktime (was: Re: systemd and timezone) Max Nikulin <manikulin@gmail.com> - 2023-12-23 18:00 +0100
                                                    Re: mktime (was: Re: systemd and timezone) Jeffrey Walton <noloader@gmail.com> - 2023-12-23 19:30 +0100
                                                      Re: mktime Max Nikulin <manikulin@gmail.com> - 2023-12-24 03:40 +0100
                                                      Re: mktime (was: Re: systemd and timezone) <tomas@tuxteam.de> - 2023-12-24 08:40 +0100
                                                    Re: mktime Max Nikulin <manikulin@gmail.com> - 2023-12-28 03:40 +0100
                                          Re: systemd and timezone Max Nikulin <manikulin@gmail.com> - 2023-12-21 16:30 +0100
                                      Re: difference in seconds between two formatted dates ... Max Nikulin <manikulin@gmail.com> - 2023-12-22 03:20 +0100
                                        Re: difference in seconds between two formatted dates ... <tomas@tuxteam.de> - 2023-12-22 08:00 +0100
                              Re: difference in seconds between two formatted dates ... David Wright <deblis@lionunicorn.co.uk> - 2023-12-21 05:40 +0100
                                Re: difference in seconds between two formatted dates ... Max Nikulin <manikulin@gmail.com> - 2023-12-21 06:50 +0100
                                  Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-21 07:10 +0100
                                    Re: difference in seconds between two formatted dates ... <tomas@tuxteam.de> - 2023-12-21 08:10 +0100
                                    Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-21 13:40 +0100
                                      Re: difference in seconds between two formatted dates ... Max Nikulin <manikulin@gmail.com> - 2023-12-21 16:40 +0100
                                        Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-21 19:30 +0100
                                      Re: difference in seconds between two formatted dates ... gene heskett <gheskett@shentel.net> - 2023-12-21 21:00 +0100
                                        Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-21 21:10 +0100
                                          Re: difference in seconds between two formatted dates ... gene heskett <gheskett@shentel.net> - 2023-12-21 21:40 +0100
                                            Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-21 22:40 +0100
                                              Re: difference in seconds between two formatted dates ... gene heskett <gheskett@shentel.net> - 2023-12-22 00:40 +0100
                                      Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-25 16:40 +0100
                                        Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-25 18:40 +0100
                                          Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-26 08:00 +0100
                                            Re: difference in seconds between two formatted dates ... "Thomas Schmitt" <scdbackup@gmx.net> - 2023-12-26 08:30 +0100
                                              Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-26 16:00 +0100
                                                Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-26 16:40 +0100
                                                  Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-26 19:40 +0100
                                                    Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-26 22:40 +0100
                                                      Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-27 01:40 +0100
                                                        Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-27 01:50 +0100
                                                          When strace breaks process or is blocked (was: Re: difference in  seconds between two formatted dates ...) Max Nikulin <manikulin@gmail.com> - 2023-12-27 17:50 +0100
              Re: difference in seconds between two formatted dates ... Max Nikulin <manikulin@gmail.com> - 2023-12-18 03:30 +0100
                Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-25 00:10 +0100
                  Re: difference in seconds between two formatted dates ... David Wright <deblis@lionunicorn.co.uk> - 2023-12-25 01:10 +0100
                    Re: difference in seconds between two formatted dates ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-25 01:30 +0100
                      Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-25 02:20 +0100
                      Re: difference in seconds between two formatted dates ... "Andrew M.A. Cater" <amacater@einval.com> - 2023-12-25 11:40 +0100
                  Re: difference in seconds between two formatted dates ... Tixy <tixy@yxit.co.uk> - 2023-12-25 09:10 +0100
                  Re: difference in seconds between two formatted dates ... Andy Smith <andy@strugglers.net> - 2023-12-27 00:00 +0100
          Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-17 19:00 +0100
          Re: difference in seconds between two formatted dates ... David Wright <deblis@lionunicorn.co.uk> - 2023-12-17 19:30 +0100
      Re: difference in seconds between two formatted dates ... Teemu Likonen <tlikonen@iki.fi> - 2023-12-17 12:50 +0100
    Re: difference in seconds between two formatted dates ... <tomas@tuxteam.de> - 2023-12-17 12:10 +0100
    Re: difference in seconds between two formatted dates ... Greg Wooledge <greg@wooledge.org> - 2023-12-17 15:10 +0100

Page 9 of 9 — ← Prev page 1 2 3 4 5 6 7 8 [9]


#265288

FromAndy Smith <andy@strugglers.net>
Date2023-12-27 00:00 +0100
Message-ID<HPoz0-gkVz-3@gated-at.bofh.it>
In reply to#265234
Hello,

On Sun, Dec 24, 2023 at 11:05:53PM +0000, Albretch Mueller wrote:
> Why would %S be in the range second (00..60), instead of
> (00..59)?:

Remember what seems like years ago in this thread when I said that
if we're being pedantic, this is more complicated than you think,
and you scoffed that it was obvious even to a schoolchild?

Welcome to the classroom, Albretch.

Thanks,m
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting

[toc] | [prev] | [next] | [standalone]


#264866

FromGreg Wooledge <greg@wooledge.org>
Date2023-12-17 19:00 +0100
Message-ID<HM3AK-eeZ6-7@gated-at.bofh.it>
In reply to#264861
On Sun, Dec 17, 2023 at 03:28:58PM +0000, Albretch Mueller wrote:
> On 12/17/23, Greg Wooledge <greg@wooledge.org> wrote:
> > On Sun, Dec 17, 2023 at 10:12:11AM +0000, Albretch Mueller wrote:
> >> ... after some long processing for which seconds would be exact
> >> enough, then I would like to get the seconds elapsed since dt00
> >
> > Are you working in bash, or sh?
> 
>  bash
> 
> > Bash offers some alternatives, to avoid having to fork two date(1)
> > processes, light as those are.  The first is:
> >
> >     unicorn:~$ printf -v dt00 '%(%s)T' -1
> >     unicorn:~$ echo "$dt00"
> >     1702821082
> 
>  but this is not what I meant and I am sure you can once again impress
> everyone here with your bash skills/wisdom. Is there such a thing as:
> 
>  dt00=$(date +%Y%m%d%H%M%S)
>  printf -(whatever the formatting for seconds would be) "${dt00}%Y%m%d%H%M%S"

No, there is nothing in bash which scans date/time strings.  You'd need
to use an external tool for this.  GNU date is one such tool.

>  I dealing with my "exposed mode" kinds of states ;-). I use a
> computer which initial state is kept as part of the file name as I
> explained, then as part of another ("exposed" or "private") reboot I
> want to check that file, so I would not be able to then simply do $((
> dt02 - dt00 ))

You've moved the goalposts.  Now the state is not being kept WITHIN
a script, but in a FILE that's used by two separate scripts (one that
writes it, and one that has to interpret it).

This is a very different kind of problem.

You'll need to choose a tool or a language that can parse your chosen
storage format.  This might be GNU date.  This might be Perl, Python,
Tcl, or some other language that has appropriate facilities for parsing
date/time strings.

You'll also be strongly encouraged to choose a storage format that
facilitates such parsing.  You might even want to work backwards --
figure out how you're going to parse the string, then choose the
format that works best with that specific parser.

[toc] | [prev] | [next] | [standalone]


#264867

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2023-12-17 19:30 +0100
Message-ID<HM43L-efow-3@gated-at.bofh.it>
In reply to#264861
On Sun 17 Dec 2023 at 15:28:58 (+0000), Albretch Mueller wrote:
> On 12/17/23, tomas@tuxteam.de <tomas@tuxteam.de> wrote:
> > On Sun, Dec 17, 2023 at 10:12:11AM +0000, Albretch Mueller wrote:
> >> dt00=$(date +%Y%m%d%H%M%S)

>  Actually, my basic idea is if you can encode a date using formatting
> options this utility provides, then you should be able to decode it
> using the same options that same utility provides, no? ... and then
> get "seconds since 1970-01-01" which wouldn't matter when you are
> computing the difference between two 10-based whole numbers which can
> be represented exactly in binary Arithmetic.

date -d expects "mostly free format human readable", which means
it won't work with arbitrary fixed formats, unless they conform
to certain standards …

> > If you could live with a datetime format which date can understand
> > (instead of your cobbled-up pseudo numeric monster above) ...
> 
>  Thank you. I learned something out of it, but I used such "cobbled-up
> pseudo numeric monster" because, in kind of a poor-man's "measured"
> way, I use size, line count, last mod and sha256 metadata in file
> names baselining the system's state. I avoid spaces and any other
> characters you can't use in most fs' and/or may be interpreted by
> shells or OSs in their own ways.

Perhaps add five characters (- - T : :) to your poor-man's format,
and stick to UTC. If the colons are an embarrassment, sed them to
hyphens for filenames and back again for date -d. If that's too
much lengthening, just use sed alone to insert/remove those five
characters appropriately. Something like:

  $ LC_ALL=C TZ=UT date -d "$(sed -E 's/(....)(..)(..)(..)(..)(..)/\1-\2-\3T\4:\5:\6/' <<<'19631122183000')" +'%s'
  -192778200
  $ LC_ALL=C TZ=UT date -d '@-192778200' +'%Y%m%d%H%M%S'
  19631122183000
  $ 

Cheers,
David.

[toc] | [prev] | [next] | [standalone]


#264856

FromTeemu Likonen <tlikonen@iki.fi>
Date2023-12-17 12:50 +0100
Message-ID<HLXOF-ebwh-3@gated-at.bofh.it>
In reply to#264852

[Multipart message — attachments visible in raw view] — view raw

* 2023-12-17 10:58:28+0000, Andy Smith wrote:

> On Sun, Dec 17, 2023 at 10:12:11AM +0000, Albretch Mueller wrote:
>> you get seconds in dt00 and dt02 and then the difference. You can't
>> go: $(( dt02 - dt00 )) because bash Arithmetic is 10-based.
>
> Why don't you just get the time as epoch time e.g. "date +%s" and
> then you can subtract one from the other¹.

Also, Bash has variable EPOCHSECONDS which expands to the current Unix
epoch time.

    $ echo $EPOCHSECONDS; sleep 5; echo $EPOCHSECONDS 
    1702812641
    1702812646

-- 
/// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/
// OpenPGP: 6965F03973F0D4CA22B9410F0F2CAE0E07608462

[toc] | [prev] | [next] | [standalone]


#264853

From<tomas@tuxteam.de>
Date2023-12-17 12:10 +0100
Message-ID<HLXbX-ebfq-15@gated-at.bofh.it>
In reply to#264851

[Multipart message — attachments visible in raw view] — view raw

On Sun, Dec 17, 2023 at 10:12:11AM +0000, Albretch Mueller wrote:
> dt00=$(date +%Y%m%d%H%M%S)
> echo "// __ \$dt00: |${dt00}|"
> 
> ... after some long processing for which seconds would be exact
> enough, then I would like to get the seconds elapsed since dt00, like
> this:
> 
> dt02=$(date +%Y%m%d%H%M%S)
> echo "// __ \$dt02: |${dt02}|"

[...]
>  because bash Arithmetic is 10-based.

You wouldn't expect bash to intuit such a crooky arithmetic as
Gregorian datetime (and then, based on what? The number beginning
with 2023? Sounds kind of exciting).

If you could live with a datetime format which date can understand
(instead of your cobbled-up pseudo numeric monster above), you might
harness date to do the work for you.

To wit

  date -I
  => 2023-12-17

(alternatively, if you want a finer resolution):

  date -Iseconds
  => 2023-12-17T11:48:28+01:00

Now date can "read" those (option -d):

  date -d $(date -Iseconds)
  => Sun Dec 17 11:49:46 CET 2023

With all of this, you can do:

  d1=$(date -Iseconds) ; sleep 5 ; d2=$(date -Iseconds)
  echo "$d1 $d2"
  => 2023-12-17T11:51:43+01:00 2023-12-17T11:51:48+01:0

and now:

  echo $(( $(date -d"$d2" +"%s") - $(date -d"$d1" +"%s") ))
  => 5

... the "%s" format indicator telling date to print "seconds since
1970-01-01". Instead of -Iseconds you can do -Ins. See the date man
page for all the gory details.

Me? I'd keep internal results always as "seconds since 1970-01-01"
and only transform on display.

Cheers
-- 
t

[toc] | [prev] | [next] | [standalone]


#264858

FromGreg Wooledge <greg@wooledge.org>
Date2023-12-17 15:10 +0100
Message-ID<HM009-ecZf-3@gated-at.bofh.it>
In reply to#264851
On Sun, Dec 17, 2023 at 10:12:11AM +0000, Albretch Mueller wrote:
> ... after some long processing for which seconds would be exact
> enough, then I would like to get the seconds elapsed since dt00

Are you working in bash, or sh?  It makes a difference here.

Others have already mentioned using "date +%s" (a GNU extension)
to get epoch time, twice, and then subtracting those.  That should
be good enough for most purposes, and it'll work in sh, as long as
you have GNU date.  (This is the *only* way that works in sh, apart
from using the "time" builtin on a function call, and parsing its
output, which I would not recommend.)

Bash offers some alternatives, to avoid having to fork two date(1)
processes, light as those are.  The first is:

    unicorn:~$ printf -v dt00 '%(%s)T' -1
    unicorn:~$ echo "$dt00"
    1702821082

This requires GNU libc(*) and bash 4.2 or higher; as an added bonus, if
you use bash 4.3 or higher, you can omit the -1 argument.

Another poster mentioned EPOCHSECONDS.  This is available in bash 5.0
or higher.  You can grab copies of this twice, and then subtract your
copies.  This has the advantage of working on systems without GNU libc
or GNU date.

Finally, there's the SECONDS variable.  You can use this in two different
ways.  The first way is to treat it like EPOCHSECONDS -- capture copies
of it twice, and subtract them.

The second way is to set it to 0 and the start of your interval, and
then capture its value at the end of your interval.

    SECONDS=0
    sleep 5
    echo "$SECONDS sec elapsed"

This works in every version of bash I've got available, so let's call
it 2.05b or higher just to be safe.  It also works without needing
GNU date or GNU libc.  If you're using bash, this is *the* most portable
option.

(*) It requires GNU libc because bash uses the system's strftime(3)
    for interpretation of the format specifier.  Therefore, %s only
    works on systems where libc has that, which means GNU and BSD are
    good, but typically not legacy Unixes.

[toc] | [prev] | [standalone]


Page 9 of 9 — ← Prev page 1 2 3 4 5 6 7 8 [9]

Back to top | Article view | linux.debian.user


csiph-web