[Previous]
[Contents]
[Next]

_strdate()

copy the current date into a given buffer

Synopsis:

#include <time.h>

char *_strdate( char *datestr )

Description:

The _strdate() function copies the current date to the buffer pointed to by datestr. The date is formatted as MM/DD/YY, where

MM
is two digits representing the month
DD
is two digits representing the day
YY
is two digits representing the year

The buffer must be at least 9 bytes long.

Returns:

A pointer to the resulting text string, datestr.

Examples:

#include <stdio.h>
#include <time.h>

void main()
  {
    char datebuff[9];

    printf( "%s\n", _strdate( datebuff ) );
  }

Classification:

WATCOM

Safety:
Interrupt handler No
Signal handler Yes
Thread Yes

Caveats:

Since the year is expressed as two digits, beware of problems with the year 2000.

See also:

asctime(), ctime(), gmtime(), localtime(), mktime(), _strtime(), time(), tzset()


[Previous]
[Contents]
[Next]