Date Time Retrieval

This function returns the date time string based on the dialog contents.

[codesyntax lang=”cpp”]

string dttmFrame::retDtm()
{
    dlgGdt dlg(this, wxID_ANY);
    dlg.idt = wxDateTime::Now();
 //   dlg.idt.ParseDateTime("2021-02-26 10:10:10");
    dlg.ctlDpc->SetValue(dlg.idt);
    dlg.TimePickerCtrl1->SetValue(dlg.idt);
    if (dlg.ShowModal() == wxID_OK)
    {
        lblStat->SetLabel(dlg.rdt.FormatISODate() + " " + dlg.rdt.FormatISOTime());
        string buf = dlg.rdt.FormatISODate().ToStdString() + " " + dlg.rdt.FormatISOTime().ToStdString();
        buf = buf;
        return buf;

    }

}

[/codesyntax]

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

Leave a Reply

Your email address will not be published. Required fields are marked *