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 liebe Community,

ich habe einen String der wie folgt aussieht:

03.01.2010 19:00:41
Diesen String will ich umfortmatieren. Danach soll er folgenden Aufbau haben:
 2010, 00, 03, 19, 00, 41

Wie ist das möglich?

MFG Basti

hallo rumdiidumdii,

also als erstes würde ich mir mal die Klasse SimpleDateFormat anschauen. Dem kann man ein Pattern mitgeben, wie yyyy.MM.dd hh:mm:ss.

Danach kann man Strings mit diesem Objekt parsen und ein java.util.Date draus machen.

Mit dem und der Klasse Calender bist Du dann eigentlich schon am Ziel.

Ich finde es allerdings etwas inkonsequent, dass Du Monate bei 0 starten willst, Tage allerdings anscheinend bei 1.

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.