Re: Prikaz date s posuvem casu a posun letni/zimni cas

Petr Pisar <[email protected]>
Newsgroups gmane.linux.region.czech
Message-ID <[email protected]>
On 2018-10-09, Petr Simek <[email protected]> wrote:
> Nicmene kdyz je vypocitany cas za datem pro prechod casu L->Z tak mi
> odecte hodinu (v pripade Z->L zase obracene hodinu pricte).
>
Potrebujete tzv. plovouci casovou zonu, protoze ve skutecnosti
nechcete pracovat s casem (pocet sekund od epochy), ale s kalendarem.

Kdybyste netrval na programu date, tak bych vam doporucil perlovy modul
DateTime:

$ perl -MDateTime -e 'my $dt = DateTime->now(time_zone => q{local})->set_time_zone(q{floating}); print qq{$dt\n}; $dt->add(days => 10); print qq{$dt\n}'
2018-10-29T18:22:55
2018-11-08T18:22:55

-- Petr

_______________________________________________
Linux mailing list
[email protected]
http://www.linux.cz/mailman/listinfo/linux
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.