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


Groups > linux.debian.user > #261831

Re: Sunrise and Sunset from terminal

From Felix Miata <mrmazda@earthlink.net>
Newsgroups linux.debian.user
Subject Re: Sunrise and Sunset from terminal
Date 2023-09-24 00:50 +0200
Message-ID <HhjBL-b2hD-3@gated-at.bofh.it> (permalink)
References <HhiPn-b1JP-3@gated-at.bofh.it> <Hhjs5-b2dz-3@gated-at.bofh.it>
Organization less than infinite

Show all headers | View raw


piorunz composed on 2023-09-23 23:35 (UTC+0100):

> #!/bin/bash

> SunTimes=$(curl --silent "https://www.timeanddate.com/sun/uk/london"
> 2>/dev/null)

> SunriseTime=$(echo "$SunTimes" | grep -o 'Sunrise Today.*' | awk '{print
> $3}' | sed 's/[^0-9]//g')
> SunsetTime=$(echo "$SunTimes" | grep -o 'Sunset Today.*' | awk '{print
> $3}' | sed 's/[^0-9]//g')

> # Optional: Insert a colon between hours and minutes
> SunriseTime="${SunriseTime:0:2}:${SunriseTime:2}"
> SunsetTime="${SunsetTime:0:2}:${SunsetTime:2}"

> echo "Sunrise Today:" $SunriseTime
> echo "Sunset Today:" $SunsetTime

> sh srss.sh
Sunrise Today: 64:7889657242711361093201601361071834
Sunset Today: 65:7242711361093201601361071834
>

That sort of resembles the half day format common outside the military.
-- 
Evolution as taught in public schools is, like religion,
	based on faith, not based on science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Sunrise and Sunset from terminal "sl91@gmx.com" <sl91@gmx.com> - 2023-09-24 00:00 +0200
  Re: Sunrise and Sunset from terminal ghe2001 <ghe2001@protonmail.com> - 2023-09-24 00:00 +0200
  Re: Sunrise and Sunset from terminal piorunz <piorunz@gmx.com> - 2023-09-24 00:40 +0200
    Re: Sunrise and Sunset from terminal Felix Miata <mrmazda@earthlink.net> - 2023-09-24 00:50 +0200
      Re: Sunrise and Sunset from terminal piorunz <piorunz@gmx.com> - 2023-09-24 01:00 +0200
        Re: Sunrise and Sunset from terminal Felix Miata <mrmazda@earthlink.net> - 2023-09-24 01:30 +0200
          Re: Sunrise and Sunset from terminal piorunz <piorunz@gmx.com> - 2023-09-24 01:40 +0200
          Re: Sunrise and Sunset from terminal Charles Curley <charlescurley@charlescurley.com> - 2023-09-24 05:00 +0200
      Re: Sunrise and Sunset from terminal Greg Wooledge <greg@wooledge.org> - 2023-09-24 01:10 +0200
        Re: Sunrise and Sunset from terminal piorunz <piorunz@gmx.com> - 2023-09-24 01:50 +0200
        Re: Sunrise and Sunset from terminal Andy Smith <andy@strugglers.net> - 2023-09-24 02:40 +0200
          Re: Sunrise and Sunset from terminal piorunz <piorunz@gmx.com> - 2023-09-24 03:00 +0200
          Re: Sunrise and Sunset from terminal Greg Wooledge <greg@wooledge.org> - 2023-09-24 05:10 +0200
            Re: Sunrise and Sunset from terminal Stefano <sl91@gmx.com> - 2023-09-24 11:30 +0200
  Re: Sunrise and Sunset from terminal Nate Bargmann <n0nb@n0nb.us> - 2023-09-24 05:00 +0200
  Re: Sunrise and Sunset from terminal Tom Browder <tom.browder@gmail.com> - 2023-09-24 22:40 +0200
  Re: Sunrise and Sunset from terminal Carles Pina i Estany <carles@pina.cat> - 2023-09-27 12:20 +0200
    Re: Sunrise and Sunset from terminal Curt <curty@free.fr> - 2023-09-27 17:50 +0200
    Re: Sunrise and Sunset from terminal Sven Hoexter <sven@stormbind.net> - 2023-09-29 16:10 +0200
  Re: Sunrise and Sunset from terminal Bruno Kleinert <fuddl@debian.org> - 2023-09-29 18:50 +0200
    Re: Sunrise and Sunset from terminal Karl Vogel <vogelke@pobox.com> - 2023-09-29 23:40 +0200

csiph-web