Skip to main content
ExLibris
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    How to format the date in Aleph

    • Article Type: General
    • Product: Aleph
    • Product Version: 20

    Description:
    (Note: This KB item was sent as Tips & Advice No. 72 to European customers.)

    There are several variables in Aleph ruling the format of dates. The various variables sometimes cause confusion so we will explain here what is the difference between them. You have:

    • aleph_date_time (defined on the server)
    • date_style_s (defined on the server)
    • date_style_f (defined on the server)
    • date_format (defined on the client)

    First of all, you can make a central definition on the server.

    The aleph_date_time variable is for customers who want to have a quick option to switch between US and European date style without having to read through much documentation. It may have two values: 1 (U.S. format) or 2 (European format). For example, 19 January 2012 will normally be displayed as 19/01/2012 in European format and 01/19/2012 in U.S. format. This variable is defined in aleph_start.

    If you want to have more options to set up the format of dates, you should edit the date_style_s and date_style_f. These variables actually rule the display of the dates in Aleph, while the aleph_date_time variable only serves for choosing which set of date_style variables should be read by the system. Example from aleph_start:

    setenv aleph_date_time 2
    #
    switch ($aleph_date_time)
    case 1:
    # US
    setenv date_style_s 15
    setenv date_style_f 16
    setenv time_style_s 04
    setenv time_style_f 04
    breaksw
    case 2:
    # European
    setenv date_style_s 11
    setenv date_style_f 12
    setenv time_style_s 01
    setenv time_style_f 01
    breaksw
    endsw

    In the above example it depends on the value of aleph_date_time if the first set of date_style variables will be read or the second set. (Note: The time_style variables are not discussed in this T&A edition.)

    As you see, every date_style variable has a two-digit value. The first digit rules the separator used in the date. The second digit rules the sequence of year, month and date.

    First digit:
    0: separator hyphen (-)
    1: separator slash (/)
    2: separator blank ( )
    3: no separator

    Second digit (if first digit is 0, 1 or 2):
    1: DDMMYY (19-01-12)
    2: DDMMYYYY (19-01-2012)
    3: DDMMMMMYYYY (19-January-2012)
    4: DDMMMYYYY (19-Jan-2012)
    5: MMDDYY (01-19-12)
    6: MMDDYYYY (01-19-2012)
    7: MMMMMDDYYYY (January-19-2012)
    8: MMMDDYYYY (Jan-19-2012)

    Second digit (if first digit is 3):
    1: DDMMYY (190112)
    2: MMDDYY (011912)
    3: YYMMDD (120119)
    4: DDMMYYYY (19012012)
    5: MMDDYYYY (01192012)
    6: YYYYMMDD (20120119)

    The variable date_style_f is for dates in forms which can be edited. The variable date_style_s is for dates on screens which are just for display.

    You may copy the date_style variables to www_server.conf and/or pc_server_defaults, and they will overwrite the default values defined in aleph_start.

    In alephcom.ini there is an additional set of variables:

    [Date_Format]
    DateSequence=dmy
    ; s or S is space in separator
    HourSeparator=:
    DateSeparator=.

    Using these variables, you can overwrite the server-side settings for date_style_f (but not for date_style_s). By editing alephcom.ini you may allow your staff to use different date formats. For example a staff member from the U.S. might want to set up another date format on his workstation than the staff member from the U.K. Note that in this place it is possible to define date separators that are not selectable in the server variables. For example you can define a dot (.) as it is a common date separator in German language countries.

    Resolution:


    • Article last edited: 10/8/2013