Home > Back-end >  Date/time conversion
Date/time conversion

Time:09-20

Warrior, could you tell me how to convert the 2017-07-13 21:50:01 into July 13, 2017, 21 50 points in a 1 second, thank you very much,

CodePudding user response:

The 2017-07-13 21:50:01 this string is how to get?

CodePudding user response:

 char sj [32]={0}; 
Unsigned short year, mon, day, hour, min, SEC, msec.
Now (). DecodeDate (& amp; Year, & amp; Mon, & amp; Day);
Now (). DecodeTime (& amp; Hour, & amp; Min, & amp; The SEC, & amp; Msec);
Sprintf (sj, "% 4 d on % d % d % d % d % d seconds", year, mon, day, hour, min, SEC);
ShowMessage (sj);


CodePudding user response:

CodePudding user response:

reference 1st floor u010165006 response:
2017-07-13 21:50:01 this string is how to get?


The date and time field in the database

CodePudding user response:

Gmzhulin
reference 4 floor response:
Quote: refer to 1st floor u010165006 response:

The 2017-07-13 21:50:01 this string is how to get?


The date and time field in the database are


The second floor method should be able to,

CodePudding user response:

 void __fastcall TForm1: : Btn_1Click (TObject * Sender) 
{
Lbl_1 - & gt; Caption=FormatDateTime (" on dd mm yyyy years hh nn points ss seconds ", StrToDateTime (" the 2017-07-13 21:50:01 "));
}
  • Related