version 6.5
SMTP_Date (smtp_ID; msgDate; msgTime; timeZone; offset{; deleteOption}) Integer
Parameter | Type | Description | |
smtp_ID | Longint | Message reference | |
msgDate | Date | Date this message was created | |
msgTime | Time | Time this message was created | |
timeZone | Integer | Location code | |
offset | Integer | Dependent on value in timeZone parameter | |
deleteOption | Integer | 0 = Add/Replace, 1 = Delete | |
Function result | Integer | Error Code |
Description
Given a date, a time, and a geographical location of the mail creator, the SMTP_Date command will build the date header for the message specified by the smtp_ID value. The date that is passed to the command should be the date and time for the current location of the machine sending the message. Since the parameters below must follow a specific format, the mail server on the receiving end of the message can interpret the date and time based on the date, time, time zone, and offset passed to it. It can then convert the sender's date and time to a local-time equivalent.
Note: If a mail message is composed without a Date header, the SMTP server will add one with its current date & time settings. All SMTP mail messages contain a date header, either added by the client application or the SMTP server.
smtp_ID is the long integer reference to the mail message created with the SMTP_New command.
msgDate is a 4D date which contains the date that this message was created.
msgTime is a time which contains the time this message was created.
timeZone identifies the time zone of the sender. This field accepts a value between zero and 6 based on the tables below.
A value of 0 (zero) allows the user to directly specify in the offset parameter the number of hours to add or subtract from Universal Time.
A value of 1 will have the sending machine automatically add the offset based on the Macintosh's PRAM. If the timeZone is 1 the offset parameter is not needed. The time zone of a Macintosh computer is determined by the settings in the Date&Time system preferences. Developers should give consideration to the accuracy of this option if the time values are a critical factor to their databases.
Values 2 through 5 correspond to the 4 time zones in the United States. The offset for each of these values specify whether that time zone is in daylight saving time (offset = 1) or not (offset = 0).
A value of 6 specifies that the time supplied will be military time. For this instance, the Military Time table below determines offset. Use the corresponding offset value (-12 through 12) based on the military time code of the location of the sender.
offset - The value of this parameter is dependent upon the code set in the timeZone parameter. See the descriptions above or the table below to find the correct value to set for this parameter.
Code | Time Zone | Offset Parameter |
0 | +/- offset from UT | Offset is in +/- Hours |
1 | +/- offset from UT | Offset not used, offset is supplied by Mac's PRAM |
2 | EST - EDT | (0 = EST, 1 = EDT) |
3 | CST - CDT | (0 = CST, 1 = CDT) |
4 | MST - MDT | (0 = MST, 1 = MDT) |
5 | PST - PDT | (0 = PST, 1 = PDT) |
6 | Military Time | See Table Below |
Offset Values | Military Time Codes |
0 | Z |
-1 thru -9 | A thru I |
-10 thru -12 | K thru M |
1 thru 12 | N thru Y |
Definitions of Abbreviations
UT | Universal Time |
EST | Eastern Standard Time |
EDT | Eastern Daylight Time |
CST | Central Standard Time |
CDT | Central Daylight Time |
MST | Mountain Standard Time |
MDT | Mountain Daylight Time |
PST | Pacific Standard Time |
PDT | Pacific Daylight Time |
deleteOption - A value of zero will add the date header with the given parameters, or replace a previously added set of values. A value of 1 causes any previous definition of this field to be removed. Any values in the other parameters are ignored. deleteOption is an optional parameter which will default to zero if not otherwise specified.
See Also