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 schaffe es leider nicht das Datum richtig zu konvertieren bzw. finde einfahc nicht die richtige Funktion dazu.

Es soll dann folgende in einer Variable aufgebaut sein.

YY.MM.DD.HH.SS

Leider finde ich hierzu keine Funktion bzw. blicke da nicht durch :-) wer kann mir helfen?

Danke schön!

Es soll dann folgende in einer Variable aufgebaut sein.

Mit "Variable" meinst du einen String?

YY.MM.DD.HH.SS

Die Minuten interessieren dich also nicht?

Leider finde ich hierzu keine Funktion bzw. blicke da nicht durch

Wenn du schon im API-Forum fragst, wäre es hilfreich, wenn du erwähnen würdest, welche API du verwendest. Je nachdem gibt es da schicke Hilfsfunktionen.

Aber am wichtigsten ist: In welcher Form liegt das Datum vor?

Mit "Variable" meinst du einen String?

Die Minuten interessieren dich also nicht?

Wenn du schon im API-Forum fragst, wäre es hilfreich, wenn du erwähnen würdest, welche API du verwendest. Je nachdem gibt es da schicke Hilfsfunktionen.

Aber am wichtigsten ist: In welcher Form liegt das Datum vor?

Sorry das ich etwas ungenau war..

Aber ich habe noch gar kein datumsformat, d.h. ich muss das Datum erst rausgbekommen....

Die Minuten interessieren mich natürlich auch , sorry aber brauche das ziemlich fixe und habe deshalb net so drüber nachgedacht....

Kein API!

Ich gehe dann einfach mal davon aus, dass du das aktuelle Datum haben möchtest...

#include <ctime>
#include <cstdio>
using namespace std;

int main()
{
time_t currenttime = time(0);
tm* t = localtime(&currenttime);

char timestring[18];
sprintf
(
timestring,
"%02d.%02d.%02d.%02d.%02d.%02d",
t->tm_year % 100,
t->tm_mon + 1,
t->tm_mday,
t->tm_hour,
t->tm_min,
t->tm_sec
);

return 0;
}[/CODE]

Genau das wollte ich vielen dank!

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.