Assists in the recognition of an appropriate date format for the object.
object.DateFormat = [string]
Where object is an object expression that evaluates to one of the controls in the Applies To list, and string is a string expression specifying the format to use.
The DateFormat property is primarily used to assist the recognition engine to interpret the format of dates sent through from the host. It can be set at the connection level, form level or object level.
It is important to note that this property does not necessarily specify the format that dates will be displayed as, in the GUI.
Where possible, the recognition engine attempts to respect the format of dates sent through from the host. This is to ensure that any dates that are sent back to the host are in the correct format. If the format of the date can be determined from the date string sent through from the host (either from the initial value in the Text property for 5250 screens, or from the format sent through with the field for OA screens) then the recognition engine will apply this formatting to any subsequent date selected from the DateCombo Box, irregardless of what is specified in the DateFormat property. An example of this would be the date string '05/22/1996'. In this case it is clear that the first two digits are the month, the second two are the day, the next four are the year and the slashes are separators. This host string date format will be used, and any format specified in the DateFormat property will be ignored.
If, however, the format cannot be clearly interpreted from the date string itself then the recognition engine will use the formatting provided in the DateFormat property (either at the form or control level) to assist in the correct interpretation of the format. For example, if the date string sent through was '05/05/05' and the DateFormat property was set to "dd/MM/yy" then the recognition engine would interpret the first two characters as the day, the next two characters as the month and the last two characters as the year. Any subsequent date selected from the DateCombo control would be formatted and sent back to the host in this format.
If the DateFormat on the control is blank or set to '(Default)' , then the DateFormat property specified for the Form will be used. If this is also blank or set to '(Default)' then the DateFormat setting specified in the Connection will be applied.
For inserted date combo box controls, if the initial date string in the Text property is in an unambiguous date format, for example a date like 24/01/2004, then this format will take precedence over the format specified in the DateFormat property. If the date format of the Text string is ambiguous, for example 01/14/01 (where it is unclear if the first 01 is the year or the day) then the format specified in the DateFormat property will be used to format any dates selected from the calendar.
The DateFormat property provides a drop down list of common date formats however it is also possible to specify a custom format using the following characters:
d |
Day of month - short (1-31) |
dd |
Day of month - long (01-31) |
ddd |
First three letters of day (e.g. Sun) |
dddd |
Full day name (e.g. Sunday) |
g |
Era |
gg |
Era |
j |
Julian day (1-366) |
jj |
Julian day (01-366) |
jjj |
Julian day (001-366) |
m |
Month - short (1-12) |
mm |
Month - long (01-12) |
mmm |
First three letters of month (e.g. Jan) |
mmmm |
Full month name (e.g. January) |
q |
Quarter (1-4) |
w |
Day of week (1-7) |
ww |
Week of year (1-53) |
y |
Day of year (1-366) |
yy |
Year - short (01) |
yyyy |
Full year - long (2001) |
/ . - |
Separators |
MM/dd/yy |
09/01/02 |
d. M. ''''yy. |
1. 9. '02. |
yy-MM-dd |
10-09-01 |
dddd dd MMM yyyy |
Wednesday 01 Sep 2010 |
Changing this property for a Form at run-time will cause the dynamic recognition engine to recreate the form and will result in the loss of any data that has been entered by the user.
This property should not be changed with the Form events OnReceive or OnRefresh.
Date Function | Connection Settings
© 2004-2021 looksoftware. All rights reserved.