Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Datumsvergleich in Perl ?

Empfohlene Antworten

Veröffentlicht

Wie kann ich 2 Datums vergleichen, ob größer oder kleiner??

Ich habe Datum 01.12.2003 und ein anderes Datum 10.12.2003. Jetzt brauche ich eine Funktion, die erkennt welches Datum kleiner ist. Die Funktion soll in Perl sein.

Die datums liegen als Variablen bereit:

datum1: $tag=01, $monat=12, $jahr=2003

datum2: $tagdatum2=15, $monatdatum2=12, $jahrdatum2=2003

Wenn Ihr eine Lösung findet, lasst es mich bitte wissen.

gruß

Mike

hi,

also ich les aus einer datei mittels regulären ausdrücken mein datum ein und dann überprüf ich es in meiner if-abfrage, hilft dir das?


$Zeilen = @SkalInhalt; #laenge des skalars wird in zeilen übergeben
for($i=$Zeilen; $i > 0; $i--)
{
for($k=0; $k < $i; $k++)
{
$Inhalt = @SkalInhalt[$k];
if($Inhalt =~ m/(\d)\|(\d\d)\D(\d\d)\D(\d\d\d\d)\|(.*?)\|(\w*)/sig)
{
$tempdatum1 = $4.$3.$2;
}

$Inhalt = @SkalInhalt[$k+1];
if($Inhalt =~ m/(\d)\|(\d\d)\D(\d\d)\D(\d\d\d\d)\|(.*?)\|(\w*)/sig)
{
$tempdatum2 = $4.$3.$2;
}

if($tempdatum1 > $tempdatum2)
{
#wenn tempdatum1 größer tempdatum2 mach blablabla
}
}
}
[/PHP]

korea1

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.