wiki:tipps_und_tricks:mit_datum_rechnen

Dies ist eine alte Version des Dokuments!


barcode

Wie kann man mit dem Datum rechnen?

Beispiele

Hier einige Beispiele

date -d "2010-02-04 11:00:00 20 minutes ago" '+%Y-%m-%d %H:%M:%S'
date -d "2010-02-04 11:00:00 120 hours ago" '+%Y-%m-%d %H:%M:%S'
date -d "2010-02-04 11:00:00 120 days ago" '+%Y-%m-%d %H:%M:%S'
date -d "2010-02-04 11:00:00 3 months ago" '+%Y-%m-%d %H:%M:%S'
date -d "2010-02-04 11:00:00 30 years ago" '+%Y-%m-%d %H:%M:%S'
date -d "last month" +%m
date -d "2 month ago" +%b
date -d "-2 month" +%B
date -d "-1 hours" +%H
date -d "tomorrow"
date -d "yesterday" +"%d %B %y"
date -d "last week" +%a

Quellen

Geben Sie Ihren Kommentar ein. Wiki-Syntax ist zugelassen:
   _  __   ___   ____    ____ __  __
  | |/_/  / _ \ / __ \  / __/ \ \/ /
 _>  <   / ___// /_/ / / _/    \  / 
/_/|_|  /_/    \____/ /_/      /_/
 
  • wiki/tipps_und_tricks/mit_datum_rechnen.1353339585.txt.gz
  • Zuletzt geändert: 2012/11/19 16:39
  • von wikiadmin