Command SMTP_Date

4D Internet Commands

SMTP_Date

version 6.5


SMTP_Date (smtp_ID; msgDate; msgTime; timeZone; offset{; deleteOption}) Integer

ParameterTypeDescription
smtp_IDLongintMessage reference
msgDateDateDate this message was created
msgTimeTimeTime this message was created
timeZoneIntegerLocation code
offsetIntegerDependent on value in timeZone parameter
deleteOptionInteger0 = 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.

CodeTime ZoneOffset Parameter
0+/- offset from UTOffset is in +/- Hours
1+/- offset from UTOffset not used, offset is supplied by Mac's PRAM
2EST - EDT(0 = EST, 1 = EDT)
3CST - CDT(0 = CST, 1 = CDT)
4MST - MDT(0 = MST, 1 = MDT)
5PST - PDT(0 = PST, 1 = PDT)
6Military TimeSee Table Below

Offset ValuesMilitary Time Codes
0Z
-1 thru -9A thru I
-10 thru -12K thru M
1 thru 12N thru Y

Definitions of Abbreviations

UTUniversal Time
ESTEastern Standard Time
EDTEastern Daylight Time
CSTCentral Standard Time
CDTCentral Daylight Time
MSTMountain Standard Time
MDTMountain Daylight Time
PSTPacific Standard Time
PDTPacific 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

SMTP_New.