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.

Date1 - Date2

Empfohlene Antworten

Veröffentlicht

Hi,

wie kann ich die differenz an Tagen zwischen zwei Date oder Calendar Objekten ermitteln, sodas auch bei Monatsüberschreitungen etc. sinnvolle ergebnisse herauskommen?


      public Object getPreviousValue() {

        GregorianCalendar cal = new GregorianCalendar();

        cal.setTime( getDate() );

        cal.add( Calendar.MINUTE, -15 );

        return cal.getTime();

      }

mmmh...

laut javadoc addiert die Methode nur Tage zu einem Datum hinzu. Ich brauche aber das Delta zwischen zwei Dates

add

oops, nicht richtig gelesen, sorry.

du koenntest aber tag, monat und jahr in int werte auslesen, und mit diesen dann arbeiten (... so als letzte alternative. wird sicherlich noch was bessere geben ...)

Nur in ganzen Tagen?

Oder in Bruchteilen.

Zu beiden möglichkeiten müsste hier was stehen.

How do I calculate the number of days between two dates?

http://java.sun.com/people/linden/faq_b2.html

Bis fast nach ganz unten scrollen.

Gruß Jaraz

Vielen Dank!!

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.