Use DateToStr to obtain an AnsiString representation of a date value that can be used for display purposes. The conversion uses the format specified by the ShortDateFormat global variable.
--
Trenutni datum dobijash sa Date()
2.
Za shtampanje forme (prozora), metoda TForm-a :
void __fastcall Print(void);
Description
Call Print to print the form. Print uses the GetFormImage method to obtain a bitmap of the form and draws that to the printer’s HDC.
Pazi fora je sto u standardnom C-u imas samo time.h koji ima rutine koje prikazuju trenutno vreme tako sto procitaju sistemsko kao i neke koje mere otkucaje kloka procesora, medjutim ono sto ti trazis nije deo standardnog C-a cak ne postoji ni instrukcija kojom se dohvata datum tako da je sve to u profesionalnim bibliotekama prevodioca i razlikuje se od sistema do sistema za win od borlanda do studia.Pozdrav.
int main()
{
time_t datum_tm = time(0);
// trenutni datum i vreme u formatu: day month date hours:minutes:seconds year
string datum_str(asctime(localtime(&datum_tm)));
cout << "Datum+Vreme: " << datum_str;
return 0;
}