How to add updated time on a button

How to add updated time on a button

BY 23 Aug 2013 Native Application Development

I’ve written the following code:

//get system DTM
    String title, date, time;
    DateTime standardTime;
    String delim(L" ");
    SystemTime::GetCurrentTime(TIME_MODE_WALL, standardTime);
    title.Append(standardTime.ToString());
    // Creates a StringTokenizer instance
    StringTokenizer strTok(title, delim);
    strTok.GetNextToken(date);
    strTok.GetNextToken(time);
    Rectangle clientRect = GetClientAreaBounds();
// Create a Button
    Button *pButton = new (std::nothrow) Button();
    pButton->Construct(Rectangle(clientRect.width / 4, 10, 680, 160));
    pButton->SetText(time);
    pButton->SetTextColor(Color(255, 251, 251));
    pButton->SetTextSize(100);
    pButton->SetColor(BUTTON_STATUS_NORMAL, Color(42, 29, 38));

 

It is showing time..but not getting updated.

How to get updated time???

 

Written by