MimeFormatDate Function  
 
LPTSTR WINAPI MimeFormatDate(
  LONG nSeconds,  
  LONG nTimezone,  
  LPTSTR lpszDate,  
  INT cchMaxDate  
);

The MimeFormatDate converts the specified date, expressed as the number of seconds since 1 January 1970, into a string compatible with the RFC 822 standard format for email messages.

Parameters

nSeconds
A long integer which specifies the number of seconds since 1 January 1970 00:00:00 UTC. This date is commonly called the epoch, and is the base date used by the standard C time functions. If the value of this parameter is zero, the current date and time is used.
nTimezone
A pointer to a long integer which is set to the difference in seconds between the specified date's timezone and Coordinated Universal Time. A value of zero specifies Coordinated Universal Time (UTC), while a positive value specifies a timezone west of UTC and a negative value specifies a timezone east of UTC. For example, Eastern Standard Time would be specified as 18000 and Pacific Standard Time would be 28800.
lpszDate
A pointer to a string buffer which will contain the formatted date. This parameter cannot be a NULL pointer.
cchMaxDate
The maximum number of characters, including the terminating null character, which may be copied into the date string buffer.

Return Value

If the function succeeds, a pointer to the date string buffer is returned. If the function fails, a NULL pointer is returned. To get extended error information, call MimeGetLastError.

Remarks

The date string is returned in a standard format as outlined in RFC 822, the document which describes the basic structure of Internet email messages. This format is as follows:

www, dd mmm yyyy hh:mm:ss [-]zzzz

Each part of the date string is defined as follows:

Format Description
www Weekday
dd Day
mmm Month
yyyy Year
hh Hour (24-hour clock)
mm Minutes
ss Seconds
zzzz Timezone

The weekday and month are displayed using standard three-character English abbreviations. The timezone is displayed as the difference (in hours and minutes) between the specified timezone and Coordinated Universal Time. For example, if the timezone is eight hours west of Coordinated Universal Time, the nTimezone value would be 28800. This would be displayed as -0800 in the formatted date string.

Note that the format of the date string is defined by the RFC 822 standard, and is not affected by localization settings on the host system.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csmsgv10.lib
Unicode: Implemented as Unicode and ANSI versions.

See Also

MimeParseDate, MimeGetMessageDate, MimeSetMessageDate