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.

Empfohlene Antworten

Veröffentlicht

Hallo,

ich sitze grad an einem Skript und muss nun das aktuelle Datum vom Tag um 6 Monate erhöhen. Wie mache ich das am besten?

$abl_dat = mktime(0, 0, 0,date("M")+6, date("D"),date("Y"));
hab das so versucht nur leider kommt da nur das dabei raus:
1215578008
Als ergebnis möchte ich halt wenn wir den heutigen Tag nehmen 09.07.2008 Das lese ich wie folgt ein:

$ers_dat = date("Y-m-d");

$ers_dat = explode('-',$ers_dat);

dann soll er mir

09.01.2009

ausgeben!

Kann mir da einer helfen?

Thx

LuZa

Hallo,

und aus dem Unix Timestamp machst Du wieder ein Datum.


$datum = getdate ($abl_dat);
echo $datum['hours'] . "\n";
echo $datum['minutes'] . "\n";
echo $datum['seconds'] . "\n";
echo $datum['mday'] . "\n";
echo $datum['mon'] . "\n";
echo $datum['year'] . "\n";
echo $datum['wday'] . "\n";
echo $datum['yday'] . "\n";
echo $datum['weekday'] . "\n";
echo $datum['month'] . "\n";
echo $datum['0'];
[/code]

Frank

Danke hat super geklappt :)

...


$abl_dat = mktime(0, 0, 0,date("M")+6, date("D"),date("Y"));
$ers_dat = date($abl_dat, "d.m.Y");
[/PHP]

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.