Default language.

Customizing date and time settings with environment variables


Use the ARDATE, ARDATEONLY, and ARTIMEONLY environment variables to customize the time and date settings for the ,  server, and . (The settings do not affect clients, but the variables can affect what is displayed in fields that contain content that the server sets.)

While processing date and time fields,  uses the format you specify with these variables. For example, to set ARDATE, use the following syntax:

% setenv ARDATE "<yourFormat>"

You can create any date formats by combining field descriptors. Field descriptors represent different components of dates and times. Available field descriptors might differ, depending on your UNIX computer type. By default, the  uses the format "%x %X".

The following table lists the UNIX field descriptors that you can use with ARDATEARDATEONLY, and ARTIMEONLY.

Descriptor

Function

%%

Same as*%*

%a

Day of week using locale's abbreviated weekday names

%A

Day of week using locale's full weekday names

%b or %h

Month using locale's abbreviated month names

%B

Month using locale's full month names

%d

Day of month (01-31)

%D

Date as %m/%d/%y

%e

Day of month (1-31; single digits are preceded by a blank)

%H

Hour (00-23)

%I

Hour (00-12)

%k

Hour (0-23; single digits preceded by a blank)--Oracle Solaris operating system only

%m

Month number (01-12)

%M

Minute (00-59)

%p

Locale's equivalent of a.m. or p.m., whichever is appropriate

%r

Time as %I:%M:%S %p

%R

Time as %H:%M

%S

Seconds (00-59)

%T

Time as %H:%M:%S

%w

Day of week (Sunday is day 0)

%x

Date, using locale's date format

%X

Time, using locale's time format

%y

Year within century (00-99)

%Y

Year, including century (for example, 2004)

The format you specify can contain any characters (including the field descriptors in the following table) in any combination that you select. To put a comma in your date, include the comma in the appropriate place in the format. 

The following table shows examples of ARDATEARDATEONLY, and ARTIMEONLY settings.

Output

ARDATE format

01/31/08

setenv ARDATE "%m/%d/%y"

31 January 2008 16:30:00

setenv ARDATE "%d %B %Y %X"

January 31 2008

setenv ARDATEONLY "%m/%d/%y"

16:30:00

setenv ARTIMEONLY "%X"

The wording of the second example might differ, according to the LANG environment variable or your system's default language.

For Windows servers, use the time and date formats listed in the Regional Options dialog box to set the environmental variables under your System settings.

Sample Windows settings

Variable

Value

Example

ARDATE

M/d/yyyy h:mm:ss

Environment-variable: ARDATE=%Y-%m-%d %H:%M:%S

ARDATEONLY

M/d/yyyy

Environment-variable: ARDATEONLY=%d %m %Y

ARTIMEONLY

h:mm:ss tt

Environment-variable: ARTIMEONLY=%H

Errors in formatting ARDATE, ARDATEONLY, and ARTIMEONLY

If you set up an incorrectly formatted ARDATEARDATEONLY, and ARTIMEONLY environment variable,  parses the correctly formatted parts and returns the invalid parts as a literal string in the date or time.  See the list of valid field descriptors above. 

It is possible to write an ARDATEARDATEONLY, and ARTIMEONLY environment variable that is correctly formatted but does not make sense. For example, avoid repeating a valid descriptor excessively (%B %B %B %B %B). If a format such as this is chosen, dates are formatted correctly on output, but the system cannot interpret any date that you specify as input.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*