Enter datetime and smalldatetime values as character strings, enclosed in single quotation marks.
Replication Server encloses datetime values in single quotation marks when it substitutes datetime values into function-string output templates. Be sure to consider this when you create function strings that include datetime variables.
The date and time portions of the data are recognized separately; therefore, the time can precede or follow the date. If you omit the time, Replication Server assumes midnight (12:00:00:000AM). If you omit the date, Replication Server assumes January 1, 1900.
Enter times according to these general rules:
Hours range from 0 to 23; minutes and seconds range from 0 to 59; milliseconds range from 0 to 999.
A value must have a colon or an “AM” or “PM” indicator to be recognized as a time value.
You can append “AM” or “PM,” with or without an intervening space. 12AM is midnight and 12PM is noon. If you specify AM, the hour must be between 1 and 12 (0 is acceptable in place of 12). If you specify PM, the hour must be between 13 and 23.
Milliseconds can be preceded by either a colon or a period. If preceded by a colon, the number means thousandths of a second. If preceded by a period, a single digit means tenths of a second, two digits mean hundredths of a second, and three digits mean thousandths of a second. For example, “12:30:20:1” means twenty and one-thousandth of a second past 12:30; “12:30:20.1” means twenty and one-tenth of a second past 12:30.
You can omit any portion of a time value. If you omit seconds, you must also omit milliseconds. If you omit minutes, you must also omit seconds and milliseconds. Replication Server assumes zero for any omitted part.
Here are some examples of time literals:
2:00 14.30 14:30:20 14:30:20:500 4pm 11:41:36 AM 12:48:5.333 pm
Enter dates with the month, day, and year in any order, subject to the following rules:
You can enter the month as a number from 1–12, or use the U.S. English month name or its three-character abbreviation.
If you use the numeric month, the date parts must be separated with slashes (/), hyphens (-), or periods (.). The date parts must be given in month-day-year order.
These examples show different ways to enter the date March 15, 1998:
3-15-1998 March-15-1998 March 15 1998 15/March/1998 March.15.1998
You can abbreviate U.S. English months to 3 characters. Case is not significant.
JAN 9 1998 31 oct 1997
When you use an alphabetic month, the month and day can be followed by a comma. These are valid dates:
Nov 17, 1997 1997 Nov, 17, 17 Nov, 1997
You can enter the year with one, two, or four digits. A one- or two-digit year less than 50 is assumed to be in the next (twenty-first) century. A two-digit year greater than or equal to 50 is in the current (twentieth) century.
Four-digit years are recognized anywhere in a date value. Two-digit years must appear after the day of the month.
You can omit the day of the month if you use the alphabetic month and a four-digit year. The day defaults to the first of the month. You cannot use separators other than commas after the month name.
Replication Server interprets these dates as May 1, 1998:
May 1998 1998 MAY may, 1998