GETN_DATETIME_CUSTOM_FORMAT

 

Contents

Name

GETN_DATETIME_CUSTOM_FORMAT

Declaration

#define GETN_DATETIME_CUSTOM_FORMAT(_STRFMT) _tmpSubNode.SetAttribute(STR_ATTRIB_DATE_TIME_CUSTOM_FORMAT, _STRFMT);

Remark

This macro custom format of date/time picker edit box in the dialogbox.

Parameters

_STRFMT
[input] Format string.
For example, to display the current date with the format "04:22:31 Tuesday Mar 23, 1996", the format string is "hh:mm:ss dddd MMM dd, yyyy".

Return

Examples

EX1

#include <GetNBox.h>
void GETN_DATETIME_CUSTOM_FORMAT_EX1()
{
        SYSTEMTIME st;
        double dDate;
        GetSystemTime(&st);
        SystemTimeToJulianDate(&dDate, &st);
        
        GETN_TREE(tree)
        GETN_DATE(DateEx, "Custom Date", dDate)
        GETN_DATETIME_CUSTOM_FORMAT( "MMM/dd (dddd) hh" )

        GETN_TIME(TimeEx, "Custom Time", dDate)
        GETN_DATETIME_CUSTOM_FORMAT( "hh:mm:ss tt" )
                        
        if ( GetNBox(tree) )
        {             
                dDate = tree.DateEx.dVal;
                JulianDateToSystemTime(&dDate, &st);
                string strDate = get_date_str(dDate, LDF_SHORT);
                out_str(strDate);
                
                dDate = tree.TimeEx.dVal;
                JulianDateToSystemTime(&dDate, &st);
                string strTime;
                strTime.Format("Custom Time: %d:%d:%d", st.wHour, st.wMinute, st.wSecond);
                out_str(strTime);
        }
}

See Also

GETN_TIME, GETN_DATE

header to Include

GetNbox.h

Reference