Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
#include <time.h>
int main(int argc, char* argv[])
{
time_t ltime;
struct tm *today;
int tag, monat, jahr;
time( <ime );
today = localtime( <ime );
// Tag, Monat, Jahr ohne Korrektur
tag = today->tm_mday; /* Tag des Monats 1-31 */
monat = today->tm_mon; /* Monat seit Januar 0-11 */
jahr = today->tm_year; /* Vergangene Jahre seit 1900 */
return 0;
}
void zeit()
{
time_t ltime;
struct tm *today;
char temp[99];
char day[99], month[99], year[99], hour[99], min[99];
time( <ime );
today = localtime( <ime );
if(today->tm_mday + 1 >= 0 && today->tm_mday + 1< 10)
sprintf(day, "0%i", today->tm_mday);
else
sprintf(day, "%i", today->tm_mday);
if(today->tm_mon >= 0 && today->tm_mon < 10)
sprintf(month, "0%i", today->tm_mon + 1);
else
sprintf(month, "%i", today->tm_mon + 1);
sprintf(year, "%i", today->tm_year + 1900);
if(today->tm_hour >= 0 && today->tm_hour < 10)
sprintf(hour, "0%i", today->tm_hour);
else
sprintf(hour, "%i", today->tm_hour);
if(today->tm_min >= 0 && today->tm_min < 10)
sprintf(min, "0%i", today->tm_min);
else
sprintf(min, "%i", today->tm_min);
sprintf(temp, "Heute ist der %s.%s.%s\n%s:%s Uhr", day, month, year, hour, min);
MessageBox(NULL, temp, "Time", MB_OK | MB_ICONINFORMATION);
}
char day[99], month[99], year[99], hour[99], min[99];
time_t ltime;
struct tm *today;
char temp[99];
char day[3], month[3], year[5], hour[3], min[3], sec[3];
time( <ime );
today = localtime( <ime );
sprintf(day, "%02i\0", today->tm_mday);
sprintf(month, "%02i\0", today->tm_mon+1);
sprintf(year, "%04i\0", today->tm_year+1900);
sprintf(hour, "%02i\0", today->tm_hour);
sprintf(min, "%02i\0", today->tm_min);
sprintf(sec, "%02i\0", today->tm_sec);
sprintf(temp, "Heute ist der %s.%s.%s\n%s:%s:%s Uhr\0", day, month, year, hour, min, sec);
printf("%s", temp);
time_t ltime;
struct tm *today;
char temp[99];
time( <ime );
today = localtime( <ime );
strftime(temp, 99, "Heute ist der %d.%m.%Y\n%H:%M:%S Uhr\0", today);
printf("%s", temp);