This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Predefined Macro

Hi

Can i change the Macro __DATE2__ to show the date as (yy-mm-dd)?

/Ingo

Parents
  • I guess you could do the following:

    char code bdate[] = __DATE2__; //mm/dd/yy
    char xdata mdate[] = "??-??-??";
    
    void main (void)
    {
    mdate[0] = bdate[6];
    mdate[1] = bdate[7];
    mdate[3] = bdate[0];
    mdate[4] = bdate[1];
    mdate[6] = bdate[3];
    mdate[7] = bdate[4];
    .
    .
    .
    }

    Jon

Reply
  • I guess you could do the following:

    char code bdate[] = __DATE2__; //mm/dd/yy
    char xdata mdate[] = "??-??-??";
    
    void main (void)
    {
    mdate[0] = bdate[6];
    mdate[1] = bdate[7];
    mdate[3] = bdate[0];
    mdate[4] = bdate[1];
    mdate[6] = bdate[3];
    mdate[7] = bdate[4];
    .
    .
    .
    }

    Jon

Children
No data