使用wxWidgets進行跨平台程式開發-zetcode_wxWidgets_helper_classes09(改寫)
zetcode_wxWidgets_helper_classes09(console application、wxPuts命令模式文字輸出-有換行、wxDateTime抓取系統時間並顯示)
#include <wx/datetime.h>
/*
http://zetcode.com/gui/wxwidgets/helperclasses/
In wxWidgets, we have several classes for working with date & time.
The example shows current date or time in various formats.
*/
int main(int argc, char **argv)
{
wxDateTime now = wxDateTime::Now();
wxString date1 = now.Format();
wxString date2 = now.Format(wxT("%X"));
wxString date3 = now.Format(wxT("%x"));
wxPuts(date1);
wxPuts(date2);
wxPuts(date3);
}
沒有留言:
張貼留言