Deutsch   English   Français   Italiano  
<fantome.forums.tDeContes-D86D9C.19015030112021@news.free.fr>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!news.trigofacile.com!usenet-fr.net!agneau.org!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed3-b.proxad.net!nnrp1-1.free.fr!not-for-mail
From: Thomas <fantome.forums.tDeContes@free.fr.invalid>
Newsgroups: fr.comp.os.unix
Mail-Copies-To: nobody
Subject: Re: obtenir le fuseau horaire
References: <fantome.forums.tDeContes-DE16C1.01290730112021@news.free.fr> <slrnsqc174.2k2t.naddy@lorvorc.mips.inka.de> <fantome.forums.tDeContes-98D87E.18352930112021@news.free.fr>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
Date: Tue, 30 Nov 2021 19:01:51 +0100
Message-ID: <fantome.forums.tDeContes-D86D9C.19015030112021@news.free.fr>
Lines: 51
Organization: Guest of ProXad - France
NNTP-Posting-Date: 30 Nov 2021 19:01:51 CET
NNTP-Posting-Host: 91.175.52.121
X-Trace: 1638295311 news-4.free.fr 3709 91.175.52.121:8343
X-Complaints-To: abuse@proxad.net
Bytes: 2505

In article 
<fantome.forums.tDeContes-98D87E.18352930112021@news.free.fr>,
 Thomas <fantome.forums.tDeContes@free.fr.invalid> wrote:

> In article <slrnsqc174.2k2t.naddy@lorvorc.mips.inka.de>,
>  Christian Weisgerber <naddy@mips.inka.de> wrote:
> 
> > On 2021-11-30, Thomas <fantome.forums.tDeContes@free.fr.invalid> wrote:
> > 
> > > y a-t-il une option avec la commande date, pour obtenir le fuseau 
> > > horaire ?
> 
> > $ date +%z
> > +0100
> 
> merci :-)
> 
> 
> pb suivant :
> comment exploiter ça pour les calculs ?
> 
> $ var1=$( date "+%z" )
> ++ date +%z
> + var1=+0100
> $ var2=$(( var1 ))
> + var2=64
> 
> je pensais qu'en analysant la chaine de texte ça déterminerais la valeur 
> 100.
> qu'est-ce qui m'échappe ?

je crois que ça l'interprète en octal à cause du 0

je peux tjr diviser par 64 tant que je n'ai qu'à traiter "+0100" et 
"+0200", et rien d'autre.

mais ça ne me plait pas bcp, parce que ça n'est pas portable !


en plus de ça, les 2 derniers chiffres sont les minutes.

est-ce qu'il est fait usage, qqpart dans le monde, de fuseaux horaires 
dont les minutes ne sont pas 0 ?

si oui,
y a-t-il un moyen assez simple d'obtenir ou de convertir ça en secondes, 
ou autre format suffisamment pratique pour les calculs ?

-- 
RAPID maintainer
http://savannah.nongnu.org/projects/rapid/