Incorrect date format in 1s 8.3. Format string. Description of the "Format" function

Built-in language functions.Format (Script functions.Format)
Script functions
Format
Syntax:
Format(<Значение>, <ФорматнаяСтрока>
Parameters:
<Значение>(required)
Type: Number; Date; Boolean. The value to be formatted.
<ФорматнаяСтрока>(optional)
Type: String. Format string is a string value that includes formatting options.
Formatting options are listed separated by the ";" symbol. The presence of the parameter means that the formatting differs from the standard one.
If the parameter is not specified, then the standard formatting which basically corresponds to converting a value to a string. However, for values ​​of type Number and Date by default (0 and 01.01.0001 00:00:00, respectively), an empty string will be returned.
Each parameter is specified by the parameter name, the "=" symbol, and the parameter value. The parameter value can be specified in single or double quotes... This is required if the parameter value contains characters used in the format string syntax. Arbitrary characters can be specified inside the parameter value, which will be displayed as is when forming the resulting string. Thus, for example, you can specify the separators for hours, minutes, and seconds when formatting time. If these characters match the format string values, they must be enclosed in single quotes.
Format string parameter names and values:
Л (L) - Name of the language, countries for which standard formatting will be performed. Available language names:
af Afrikaans
af_ZA Afrikaans (South Africa)
am Amharic
am_ET Amharic (Ethiopia)
ar Arabic
ar_AE Arabic (United Arab Emirates)
ar_BH Arabic (Bahrain)
ar_DZ Arabic (Algeria)
ar_EG Arabic (Egypt)
ar_IQ Arabic (Iraqi)
ar_JO Arabic (Jordan)
ar_KW Arabic (Kuwait)
ar_LB Arabic (Lebanon)
ar_LY Arabic (Libya)
ar_MA Arabic (Morocco)
ar_OM Arabic (Oman)
ar_QA Arabic (Qatar)
ar_SA Arabic (Saudi Arabia)
ar_SD Arabic (Sudan)
ar_SY Arabic (Syria)
ar_TN Arabic (Tunisia)
ar_YE Arabic (Yemen)
as Assamese
as_IN Assamese (India)
az Azerbaijani
az_AZ Azerbaijani (Azerbaijan)
az_Cyrl Azerbaijani (Cyrillic)
az_Cyrl_AZ Azerbaijani (Cyrillic, Azerbaijan)
az_Latn Azerbaijani (Latin)
az_Latn_AZ Azerbaijani (Latin, Azerbaijan)
be Belarusian
be_BY Belarusian (Belarus)
bg Bulgarian
bg_BG Bulgarian (Bulgaria)
bn Bengali
bn_IN Bengali (India)
ca Catalan
ca_ES Catalan (Spain)
cs Czech
cs_CZ Czech (Czech Republic)
cy Welsh
cy_GB Welsh (UK)
da Danish
da_DK Danish (Denmark)
de German
de_AT German (Austria)
de_BE German (Belgium)
de_CH German (Switzerland)
de_DE German (Germany)
de_LU German (Luxembourg)
el Greek
el_GR Greek (Greece)
en English
en_AU English (Australia)
en_BE English (Belgium)
en_BW English (Botswana)
en_CA English (Canada)
en_GB English (UK)
en_HK English (Hong Kong SAR China)
en_IE English (Ireland)
en_IN English (India)
en_MT English (Malta)
en_NZ English (New Zealand)
en_PH English (Philippines)
en_PK English (Pakistan)
en_SG English (Singapore)
en_US English (United States of America)
en_VI English (US Virgin Islands)
en_ZA English (South Africa)
en_ZW English (Zimbabwe)
es Spanish
es_AR Spanish (Argentina)
es_BO Spanish (Bolivia)
es_CL Spanish (Chile)
es_CO Spanish (Colombia)
es_CR Spanish (Costa Rica)
es_DO Spanish (Dominican Republic)
es_EC Spanish (Ecuador)
es_ES Spanish (Spain)
es_GT Spanish (Guatemala)
es_HN Spanish (Honduras)
es_MX Spanish (Mexico)
es_NI Spanish (Nicaragua)
es_PA Spanish (Panama)
es_PE Spanish (Peru)
es_PR Spanish (Puerto Rico)
es_PY Spanish (Paraguay)
es_SV Spanish (El Salvador)
es_US Spanish (United States of America)
es_UY Spanish (Uruguay)
es_VE Spanish (Venezuela)
et Estonian
et_EE Estonian (Estonia)
eu Basque
eu_ES Basque (Spain)
fa Persian
fa_AF Persian (Afghanistan)
fa_IR Persian (Iran)
fi Finnish
fi_FI Finnish (Finland)
fo Faroese
fo_FO Faroe (Faroe Islands)
fr French
fr_BE French (Belgium)
fr_CA French (Canada)
fr_CH French (Switzerland)
fr_FR French (France)
fr_LU French (Luxembourg)
ga Irish
ga_IE Irish (Ireland)
gl Galician
gl_ES, Galician (Spain)
gu Guiarati
gu_IN Guyarati (India)
he Hebrew
he_IL Hebrew (Israel)
hi hindi
hi_IN Hindi (India)
hr Croatian
hr_HR Croatian (Croatia)
hu Hungarian
hu_HU Hungarian (Hungary)
hy Armenian
hy_AM Armenian (Armenia)
hy_AM_REVISED Armenian (Armenia, REVISED)
id Indonesian
id_ID Indonesian (Indonesia)
is Icelandic
is_IS Icelandic (Iceland)
it Italian
it_CH, Italian (Switzerland)
it_IT Italian (Italy)
ja Japanese
ja_JP Japanese (Japan)
ka Georgian
ka_GE Georgian (Georgia)
kk Kazakh
kk_KZ Kazakh (Kazakhstan)
kl Greenlandic
kl_GL Greenlandic (Greenland)
kn Kannada
kn_IN Kannada (India)
ko Korean
ko_KR Korean (South Korea)
kok Konkani
kok_IN Konkani (India)
lt Lithuanian
lt_LT Lithuanian (Lithuania)
lv Latvian
lv_LV Latvian (Latvia)
mk Macedonian
mk_MK Macedonian (Macedonia)
ml Malayalam
ml_IN Malayalam (India)
mr Maratiyskiy
mr_IN Marathi (India)
ms Malay
ms_BN Malay (Brunei)
ms_MY Malay (Malaysia)
mt Maltese
mt_MT Maltese (Malta)
nb Norwegian Bokmål
nb_NO Norwegian Bokmål (Norway)
nl Dutch
nl_BE Dutch (Belgium)
nl_NL Dutch (Netherlands)
nn Norwegian Nynorsk
nn_NO Norwegian Nynorsk (Norway)
om Oromo (Athan)
om_ET Oromo (Afan) (Ethiopia)
om_KE Oromo (Afan) (Kenya)
or Oriya
or_IN Oriya (India)
pa Punjabi
pa_IN Punjabi (India)
pl Polish
pl_PL Polish (Poland)
ps Pashto (Pashto)
ps_AF Pashto (Pushto) (Afghanistan)
pt Portuguese
pt_BR Portuguese (Brazil)
pt_PT Portuguese (Portugal)
ro Romanian
ro_RO Romanian (Romania)
ru Russian
ru_RU Russian (Russia)
ru_UA Russian (Ukraine)
sk Slovak
sk_SK Slovak (Slovakia)
sl Slovenian
sl_SI Slovenian (Slovenia)
so Somalia
so_DJ Somalia (Djibouti)
so_ET Somalia (Ethiopia)
so_KE Somalia (Kenya)
so_SO Somalia (Somalia)
sq Albanian
sq_AL Albanian (Albania)
sr Serbian
sr_CS Serbian (Serbia and Montenegro)
sr_Cyrl Serbian (Cyrillic)
sr_Cyrl_CS Serbian (Cyrillic, Serbia and Montenegro)
sr_Cyrl_YU Serbian (Cyrillic, Yugoslavia)
sr_Latn Serbian (Latin)
sr_Latn_CS Serbian (Latin, Serbia and Montenegro)
sr_Latn_YU Serbian (Latin, Yugoslavia)
sr_YU Serbian (Yugoslavia)
sv Swedish
sv_FI Swedish (Finland)
sv_SE Swedish (Sweden)
sw Swahili
sw_KE Swahili (Swahili)
sw_TZ Swahili (Tanzania)
ta Tamil
ta_IN Tamil (India)
te Telugu
te_IN Telugu (India)
th Thai
th_TH Thai (Thailand)
ti Tigrinia
ti_ER Tigrinia (Eritrea)
ti_ET Tigrinia (Ethiopia)
tr Turkish
tr_TR Turkish (Turkey)
uk Ukrainian
uk_UA Ukrainian (Ukraine)
ur urdu
ur_PK Urdu (Pakistan)
uz Uzbek
uz_Cyrl Uzbek (Cyrillic)
uz_Cyrl_UZ Uzbek (Cyrillic, Uzbekistan)
uz_Latn Uzbek (Latin)
uz_Latn_UZ Uzbek (Latin, Uzbekistan)
uz_UZ Uzbek (Uzbekistan)
vi Vietnamese
vi_VN Vietnamese (Vietnam)
zh Chinese
zh_CN Chinese (China)
zh_Hans Chinese (Hans)
zh_Hans_CN Chinese (Hans, China)
zh_Hans_SG Chinese (Hans, Singapore)
zh_Hant Chinese (Hant)
zh_Hant_HK Chinese (Hant, Hong Kong (Special Administrative Area, China))
zh_Hant_MO Chinese (Hant, Macau (Special Administration Area, China))
zh_Hant_TW Chinese (Hant, Taiwan)
zh_HK Chinese (Hong Kong SAR, China)
zh_MO Chinese (Macau (Special Administration Area, China))
zh_SG Chinese (Singapore)
zh_TW Chinese (Taiwan)
ND - The total number of displayed decimal places for whole and fractional parts. In this case, the original number is rounded in accordance with the rules for rounding off OKr15 to 20. If this parameter is specified, then to display the fractional part of a number, it is necessary to indicate the NPV parameter, otherwise the fractional part will not be displayed.
NFD - The number of decimal places in the fractional part. In this case, the original number is rounded in accordance with the rules for rounding off OKr15 to 20.
ChS (NS) - Displacement of digits: positive - division, negative - multiplication. In other words, this means that the original number will be multiplied or divided by 10 * С, where С is the modulo value of the parameter.
RND (NDS) - Integer and fractional separator character.
ChRG (NGS) - The character separator of groups of integer part of a number. If you use an empty string as a separator, then the non-breaking space character will be the separator.
CHN (NZ) - A string representing the zero value of a number. If not specified, then the empty string representation. If "CHN =" is specified, then in the form of "0". Not used for numeric input fields.
CHVN (NLZ) - Whether it is necessary to output leading zeros. The value of this parameter is not specified, the presence of the parameter itself determines the output of leading zeros.
ЧГ (NG) - The order of grouping of the digits of the number. The values ​​are numbers, separated by commas, indicating the number of digits to be grouped from right to left. To indicate that the last grouping number should be repeated for all high-order digits, then 0 is indicated after it, separated by commas.
CHO (NN) - Representation of negative numbers.
0 - a string like "(1,1)";
1 - a string like "-1,1";
2 - a line like "- 1.1";
3 - a line like "1,1-";
4 - a line like "1,1 -".
DF (DF) - Date format.
d (d) - day of the month (in digits) without a leading zero;
dd (dd) - day of the month (in digits) with a leading zero;
ddd (ddd) - short name of the day of the week *);
dddd (dddd) - full name of the day of the week *);
М (M) - month number (in digits) without a leading zero;
MM (MM) - month number (in digits) with a leading zero;
MMM (MMM) - short name of the month *);
MMMM (MMMM) - full name of the month *);
к (q) - number of a quarter in a year;
г (y) - number of the year without century and leading zero;
yy (yy) - year number without century with leading zero;
yyyy (yyyy) - year number with century;
h (h) - hour in 12 hour version without leading zeros;
hh (hh) - hour in 12 hour variant with leading zero;
H (H) - hour in the 24-hour variant without leading zeros;
HH (HH) - hour in 24-hour variant with leading zero;
m (m) - minute without leading zero;
mm (mm) - minute with a leading zero;
s (s) - second without leading zero;
ss (ss) - second with a leading zero;
bc (tt) - displays half day AM / PM (valid only for configuration languages ​​that support 12 hour clock).
Note: *) - is not used for the format string of the date input field.
DLF (DLF) - Local date format. Specifies the display option for date parts.
D (D) - date (in numbers);
DD (DD) - long date (month in words);
B (T) - full time, date can be combined with time;
DV (DT) - date time.
Example: The expression Format ("20051120140323", "DLF = DDV") has the value "Nov 20, 2005 14:03:23".
Important! Order of format string options for DLF<дата + время>(DV or DDV) cannot be changed.
DP (DE) - A string representing an empty date (for example, Format ("00010101000000", "DP =" "empty date" "") will return the string "empty date").
BL (BF) - A string representing the logical value False.
BI (BT) - A string representing the logical value True.
Note. Using parameters for the input field: parameter DP (DE) is not used; parameter DLF (DLF) is used only with the values ​​of D (D), V (T) and DV (DT).
Returned value:
Type: String. The string resulting from the formatting of the passed value.
Description:
Provides an easy-to-read representation of values. Useful for reports and other visual display of values.

Availability:
Thin client, web client, server, external connection.
Example:
// Examples of formatting numbers
A = Format (123456.789, "BHT = 10; BHC = 2");
// A = "123 456.79"
A = Format (123456.789, "RRD =" - "");
// A = "123 456-789"
A = Format (-123456.789, "CHO ​​= 0");
// A = "(123 456,789)";

// Examples of formatting dates
A = Format ("20020820153309", "DF =" "dd MMMM yyyy" g. "HH: mm: ss" "");
// A = "August 20, 2002 15:33:09"
A = Format ("20020820153309", "DF =" "dd / MM-yyyy" "");
// A = "20 / 08-2002"
A = Format ("20020820153309", "DLF = DD");
// A = "August 20, 2002";
A = Format ("20020820153309", "DLF = D");
// A = "08/20/2002";
A = Format ("20020820153309", "DLF = B");
// A = "15:33:09";

// Examples of formatting logical expressions
A = Format (True, "BL = Absent; BI = Available");
// А = "Available";

Type: Number; Date; Boolean. The value to be formatted.<ФорматнаяСтрока> (optional) Type: String. The format string is a string value that includes formatting options. Formatting options are listed through the ";" symbol. The presence of the parameter means that the formatting differs from the standard one. If the parameter is not specified, then standard formatting is applied, which basically corresponds to converting the value to a string. However, for values ​​of type Number and Date by default (0 and 01.01.0001 00:00:00, respectively), an empty string will be returned. Each parameter is specified by the parameter name, the "=" symbol and the parameter value. The parameter value can be specified in single or double quotes. This is required if the parameter value contains characters used in the format string syntax. Arbitrary characters can be specified inside the parameter value, which will be displayed as is when forming the resulting string. Thus, for example, you can specify the separators for hours, minutes, and seconds when formatting time. If these characters match the format string values, they must be enclosed in single quotes. The names and values ​​of the format string parameters: Л (L) - the name of the language, country for which standard formatting will be performed. Available language names are located after the format string description. ND is the total number of displayed decimal places for whole and fractional parts. In this case, the original number is rounded in accordance with the rules for rounding off OKr15 to 20. If this parameter is specified, then to display the fractional part of a number, it is necessary to indicate the NPV parameter, otherwise the fractional part will not be displayed. NFD - the number of decimal places in the fractional part. In this case, the original number is rounded in accordance with the rules for rounding off OKr15 to 20. ChS (NS) - shift of digits: positive - division, negative - multiplication. In other words, this means that the original number will be multiplied or divided by 10 * С, where С is the modulo value of the parameter. RLD (NDS) - the character separator of integer and fractional parts. ChRG (NGS) - a character separator of groups of integer part of a number. If you use an empty string as a separator, then the non-breaking space character will be the separator. CHN (NZ) is a string representing the zero value of a number. If not specified, then the empty string representation. If "CHN =" is specified, then in the form of "0". Not used for numeric input fields. CHVN (NLZ) - whether to output leading zeros. The value of this parameter is not specified, the presence of the parameter itself determines the output of leading zeros. ЧГ (NG) - the order of grouping the digits of the number. The values ​​are numbers, separated by commas, indicating the number of digits to be grouped from right to left. Only the first two numbers make sense. The first of them indicates the primary grouping, that is, the one that will be used for the least significant digits of the integer part of the number. If the second number is not specified, then only the least significant digits will be grouped. If 0 is specified as the second number, then the value specified for the primary grouping will be applied to all digits of the integer part of the number. If a value other than 0 is used as the second number, then this value will be used to group all the digits, except for the least significant ones already grouped. CHO (NN) - represent negative numbers. 0 (0) - a string like "(1,1)"; 1 (1) - a string like "-1,1"; 2 (2) - a string like "- 1,1"; 3 (3) - a string like "1,1-"; 4 (4) - a string like "1,1 -". DF (DF) - date format. d (d) - day of the month (in digits) without a leading zero; dd (dd) - day of the month (in digits) with a leading zero; ddd (ddd) - short name of the day of the week *); dddd (dddd) - full name of the day of the week *); М (M) - month number (in digits) without a leading zero; MM (MM) - month number (in digits) with a leading zero; MMM (MMM) - short name of the month *); MMMM (MMMM) - full name of the month *); к (q) - number of a quarter in a year; г (y) - number of the year without century and leading zero; yy (yy) - year number without century with leading zero; yyyy (yyyy) - year number with century; h (h) - hour in 12 hour version without leading zeros; hh (hh) - hour in 12 hour variant with leading zero; H (H) - hour in the 24-hour variant without leading zeros; HH (HH) - hour in 24-hour variant with leading zero; m (m) - minute without leading zero; mm (mm) - minute with a leading zero; s (s) - second without leading zero; ss (ss) - second with a leading zero; bc (tt) - displays half day AM / PM (valid only for configuration languages ​​that support 12 hour clock). Note: *) - is not used for the format string of the date input field. DLF (DLF) - local date format. Specifies the display option for date parts. D (D) - date (in numbers); DD (DD) - long date (month in words); B (T) - full time, date can be combined with time; DV (DT) - date time. Example: The expression Format (‘20051120140323’, “DLF = DDV”) has the value “Nov 20, 2005 14:03:23 ″. Important! Order of format string options for DLF<дата + время> (DV or DDV) cannot be changed. DP (DE) is a string representing an empty date (for example, Format (‘00010101000000’, “DP =” “empty date” ””) will return the string “empty date”). BL (BF) - a string representing the Boolean value False. BI (BT) - a string representing the logical value True. Note. Using parameters for the input field: parameter DP (DE) is not used; parameter DLF (DLF) is used only with the values ​​of D (D), V (T) and DV (DT). Returned value: Type: String. The string resulting from the formatting of the passed value. Description: Provides an easy-to-read representation of values. Useful for reports and other visual display of values. Availability: Thin Client, Web Client, Server, Fat Client, Outside Connection, Mobile App (Client), Mobile App (Server). List of languages: af Afrikaans af_NA (af_NA) Afrikaans (Namibia) af_ZA Afrikaans (South Africa) am Amharic am_ET Amharic (Ethiopia) ar Arabic ar_AE Arabic (United Arab Emirates) ar_BH Arabic (Bahrain) ar_DZ Arabic (Algeria) ar_EG Arabic (Egypt) ar_IQ Arabic (Iraq) ar_JO Arabic (Jordan) ar_KW Arabic (Kuwait) ar_LB Arabic (Lebanon) ar_LY Arabic (Libya) ar_MA Arabic (Morocco) ar_OM Arabic (Oman) ar_QA Arabic (Qatar) ar_SA Arabic (Saudi Arabia) (ar_SA) ) ar_SY Arabic (Syria) ar_TN Arabic (Tunisia) ar_YE Arabic (Yemen) as Assamese as_IN Assamese (India) az Azeri az_AZ Azeri (Azerbaijan) az_Cyrl Azeri (Cyrillic) az_Cyrl_AZ Azeri (Cyrillic, Azerbaijan) az_Latn Azeri (Latin_AZ) Latin, Azerbaijan) be Belarusian be_BY Belarusian (Belarus) bg Bulgarian bg_BG Bulgarian (Bulgaria) bn Bengali bn_IN Bengali (India) ca Catalan ca_ES Catalans cue (Spain) cs Czech cs_CZ Czech (Czech Republic) cy Welsh cy_GB Welsh (UK) da Danish da_DK Danish (Denmark) de German de_AT German (Austria) de_BE German (Belgium) de_CH German (Switzerland) de_DE German (Germany) de_LI ( de_LI) German (Liechtenstein) de_LU German (Luxembourg) el Greek el_CY (el_CY) Greek (Cyprus) el_GR Greek (Greece) en English en_AU English (Australia) en_BE English (Belgium) en_BW English (Botswana) en_BZ (en_BZ) English (Belize) ) en_CA English (Canada) en_GB English (UK) en_HK English (Hong Kong, (SAR, China)) en_IE English (Ireland) en_IN English (India) en_JM (en_JM) English (Jamaica) en_MH (en_MH) English ( Marshall Islands) en_MT English (Malta) en_NA (en_NA) English (Namibia) en_NZ English (New Zealand) en_PH English (Philippines) en_PK English (Pakistan) en_SG English (Singapore) en_TT (en_TT) English th (Trinidad and Tobago) en_US English (United States of America) en_VI English (US Virgin Islands) en_ZA English (South Africa) en_ZW English (Zimbabwe) es Spanish es_AR Spanish (Argentina) es_BO Spanish (Bolivia) es_CL Spanish (Chile) es_CO Spanish (Colombia) es_CR Spanish (Costa Rica) es_DO Spanish (Dominican Republic) es_EC Spanish (Ecuador) es_ES Spanish (Spain) es_GT Spanish (Guatemala) es_HN Spanish (Honduras) es_MX Spanish (Mexico) es_NI Spanish (Nicaragua) Spanish (Panama) ) es_PE Spanish (Peru) es_PR Spanish (Puerto Rico) es_PY Spanish (Paraguay) es_SV Spanish (El Salvador) es_US Spanish (United States of America) es_UY Spanish (Uruguay) es_VE Spanish (Venezuela) et Estonian et_EE Estonian (Estonia) eu_ES Basque Basque (Spain) fa Persian fa_AF Persian (Afghanistan) fa_IR Persian (Iran) fi Finnish fi_FI Finnish (Finland) fo Faroese fo_FO Faroese (Faroe Islands) fr French fr_BE French (Belgium) fr_CA French (Canada) fr_CH French (Switzerland) fr_FR French (France) fr_LU French (Luxembourg) fr_MC (fr_MC) French (Monaco) fr_SN (fr_SN) French (Senegal) ga Irish ga_IE Irish (Ireland) gl Galician gl_ES, Galician (Spain) gu Guyarati gu_IN Guyarati (India) he Hebrew he_IL Hebrew (Israel) hi Hindi hi_IN Hindi (India) hr Croatian hr_HR Croatian (Croatia) hu Hungarian hu_HU Hungarian (Hungary) hy Armenian Armenia hy_VEDAM Armenian_ Armenian (Armenia, REVISED) id Indonesian id_ID Indonesian (Indonesia) is Icelandic is_IS Icelandic (Iceland) it Italian it_CH, Italian (Switzerland) it_IT Italian (Italy) ja Japanese ja_JP Japanese (Japan) ka Georgian ka_GE Georgian (Georgia) kk Kazakh kk_KZ Kazakh (Kazakhstan) kl Greenlandic kl_GL Greenlandic (Greenland) kn Kannada kn_IN Kannada (India) ko Korean ko_KR Korean (South Korea) kok Konkani kok_IN Konkani (Indus iya) ky Kyrgyz ky_KY Kyrgyz (Kyrgyzstan) lt Lithuanian lt_LT Lithuanian (Lithuania) lv Latvian lv_LV Latvian (Latvia) mk Macedonian mk

* .cf- the file contains only configuration (code and structure) without user data. Created from the 1C 8.x configurator: "Configuration -> Save configuration to file" or "Configuration -> Delivery configuration -> Create delivery file and update configuration -> sign" Create delivery file "".

* .cfu- the file contains only configuration update. For example file 1cv8.cfu. It is impossible to create a configuration from this file, since it contains only the differences between the new configuration and the previous one. Created from the 1C 8.x configurator: "Configuration -> Delivery configuration -> Create delivery file and configuration update -> sign" Create configuration update file "".

* .dt- the file contains the configuration along with the user database. This is a specialized 1C 8 archive format. It is created from the 1C 8.x configurator: "Administration -> Unload information base".

* .epf (* .erf) - external processing (report) file. Any processing (report) from the configuration can be saved external. Created from the 1C 8.x configurator: "Configuration -> Open configuration -> we go to the required processing (report) -> select right click mouse -> Save as external processing, report ... ".

* .1cd- a full-fledged database file. The default name representation is 1Cv8.1CD. Includes configuration, database, user preferences. Opens platform 1C 8.x. Created for the development of a new configuration automatically by clicking the "Add" button when selecting the item "Create a new information base».

* .log, * .lgf, * .lgp, * .elf- log files that collect information (register data) in 1C 8.0 8.1, 8.2, 8.3.

*. cdn - file with this extension ( 1Cv8.cdn) is used for manual or automatic blocking 1C Enterprise databases eighth version.

* .mxl- files of printed forms are used, including in 1C. They are both printed forms of documents, reference books, reports, and various data storage devices for various classifiers. Opens through the Configurator or in 1C: Enterprise mode through "file -> open". It is created in the same way: in the Configurator mode or in 1C: Enterprise via "file -> new". Also, files with such extensions can serve as transfer rules, for example, from 1C 7.7 to 8.2 (acc77_82.xml and auxiliary processing exp77_82.ert) - they are usually located in the ExtForms folder.

* .efd- this is a 1C archive file, used to set the configuration. Contains either configuration 1c or an update to it. It is launched using the auxiliary executable file setup.exe (must be located in the same folder).

* .mft- an auxiliary file for creating a configuration from a template. Contains configuration information, description, path, title. It is used directly by the platform itself when creating a 1C infobase from a template.

* .grs- files of graphic schemes in a specialized 1C format. Opens through the Configurator or in 1C: Enterprise mode through "file -> open". It is created in the same way: in the Configurator mode or in 1C: Enterprise via "file -> new".

* .geo- files of geographic schemes in a specialized 1C format. Opens through the Configurator or in 1C: Enterprise mode through "file -> open". It is created in the same way: in the Configurator mode or in 1C: Enterprise via "file -> new".

* .st- text template files. They are mainly used by 1C developers.

* .pff- file with saved performance measurements. Used by system administrators and 1C specialists.

Programming (and business programs) usually deal with the following simple data types: number, string, date. Values ​​of these types for different countries, standards and just habits can have different ideas.

Probably the most famous example is the different representation of time - in Russia it is customary to use 9:00 and 21:00, and in English-speaking countries 9am and 9pm. The difference is both in logic (12-hour system or 24-hour system) and in spelling.

The representation of the value is called "format" and today we will discuss changing the date format and number format in 1C.
You can use formatting as a programmer in the 1C language, and visually, without programming, for example, when creating a printed form or report, when setting up elements on a form.

What is formatting

The date and date, regardless of whether they are displayed on the screen or printed, remains the same. Formatting implies only conversion to a string value - that is, how it will "look" on a computer screen or on paper.

The main differences between 1C formats for representing numbers and dates:

  • Number
    o "." or "," to separate the fractional part
    o number of decimal places
    o grouping of digits in a number by 3 (1,000,000, not 1,000,000)
  • date and time
    o order of year, month, day
    o delimiter character
    o 1C time format (12 or 24 hours)
    o writing details.

Also, in the 1C format, additional "conveniences" can be indicated, for example, negative numbers can be displayed in red, or the representation of an "empty value" in the form of "0" or "not filled".

Formatting principle

The default formatting works, for example, when converting a number to a string. In some cases, such settings can serve as a bad service where the programmer does not expect it.

For example, when translating a number into a string, it is translated taking into account the grouping of digits (do you expect this?):
NumberString = SokrLP (2400); // will be equal to "2,400"

To specify the exact format in the 1C language, there is the Format () function, with which it is possible to specify the required representation.
Number Line = Format (2400, "Settings")

As the line "Settings" you need to specify the required 1C format. Such settings are indicated in a special encoded form. Let's take a look at the most commonly used settings:

1C date and number format by default

If you need to display a date or number and do not want to bother knowing how they should be presented according to the rules of the required country, there is a simple setting that will allow you to do this:

L = Short Name of Desired Country

An example of a date display according to the rules of some countries:
Format (CurrentDate (), "L = ru")
> 28.03.2012 14:21:32

Format (CurrentDate (), "L = en")
> 3/28/2012 2:21:24 PM

Format (CurrentDate (), "L = fr")
> 28/03/2012 14:22:08

It is not difficult to see that the names of the countries are intuitive.

Date format in 1C language

If the default setting is not enough for you and you would like to specify the order of the date parts and the characters for separating them yourself, you must use the setting:
DF = "dmg chms"

Accordingly, "dmg" is the day, month and year, and "chms" are hours, minutes and seconds. Any of these parts can be skipped. The order is any. Characters specified between parts will be used as separator characters.

The character of the date part can be specified several times in a row, the type of this part of the date depends on it, for example, "d" or "dd" or "dddd".

Decoding the parts of the date:

  • d - day
    o small "d"
  • M - month
    o big "M"
    o can be specified from 1 to 4 times
  • y - year
    o small "g"
    o can be specified 1 or 2 or 4 times
  • h - hours
    o small "h" - 12 hour format
    o large "H" - 24 hour format
  • m - minutes
    o small "m"
    o can be specified 1 or 2 times
  • s - seconds
    o small "c"
    o can be specified 1 or 2 times
  • cc - display AM / PM for 12 hour format
  • k - quarter.

An example of a date display indicating the rules:
Format (CurrentDate (), "DF =" "dd.MM.yyyy hh: mm: ss" "")
> 28.03.2012 02:44:44

Format (CurrentDate (), "DF =" "M / d / yyyy h: m: s cv" "")
> 3/28/2012 2:44:44 PM

Format (CurrentDate (), "DF =" "dd / MM / yyyy hh: mm: ss" "")
> 28/03/2012 02:44:44

Number format in 1C language
Unlike date formatting, which is fairly straightforward, there are many options for number formatting. We will consider those that seemed useful to us - that is, in our opinion, they are often used.

The first "problem" has to do with the default grouping of digits in numbers by 3 and separating the groups with a space, for example:
StringNumber = String (22300500)
> 22 300 500

This is inconvenient when a number is converted to a string not for a nice and understandable display to the user, but for service needs. This can be influenced by the "CH" parameter, for example:

Format (22300500, "CG = 100")
> 22300500 // removed zeros altogether

Format (22300500, "CHG = 6")
> 22 300 500 // grouped only millions

A parameter that allows you to round the number when displayed to the required number of digits after the decimal point "CDC":

Format (3.535353, "CHDTs =" "2" "")
> 3,54

The parameter that allows you to specify the integer and fractional separator character "RHD":

Format (3.535353, "RRD =" "." "")
> 3.535353

For some cases, it is useful to be able to display something else instead of the number "0": an empty string or "not filled". This allows you to do the "CHN" parameter:

Format (0, "CHN =" "" "")
>

1C field format on the form

We have reviewed with you the techniques that allow the programmer to format the value in the 1C language. There are also mechanisms that allow you to specify the required format visually, without programming.

For example, a user is working with a form. The form has a field that displays the date. We can influence the presentation of this date.

Open the properties for this field. To do this, in the thick client, right-click on the field, and in the thin client, right-click on the field name in the list of fields, select Properties.
The field has a Format property.

Click the "..." button to customize it. To set the date format use the Date tab (for a date - the Number tab). You can select the required format from the list.

Format 1C cells in printed form

When you need to design a printable (report or printout of a document), you can assign a cell format in exactly the same way as for a document field.
Select a cell (or several cells at the same time), go to the properties, property "Format", select the required format.

1C format in ACS

ACS reports allow you to customize the 1C format both for the programmer (at the time of creating the report) and for the user (when using the report). There are also more possibilities due to the use of conditional formatting.

This means you not only indicate which field how to format, but also under what condition (for example, if the value of this field is negative).

In Enterprise mode, select the "Change variant" menu item on the report form. In the ACS report in the thick client, this item is in the Actions / Settings menu.

In the opened form of all ACS settings there is a tab "Conditional formatting". Add new line... The line has three columns:

  • Registration. Specify the required 1C format - font, background or text color, 1C format for displaying numbers and dates
  • Condition. If this design is always applied, then leave this field empty. Otherwise, specify the field and its value. Then the formatting will be applied only to those lines in which these values ​​are the same. If you need to specify the values ​​of several fields at the same time and conditions "and / or" - add a group and group the fields using groups.
  • Formable fields. List of fields for which formatting will be applied.

1C format in managed forms

Similar formatting rules apply to any form of a managed client list. In the form of the list, select the menu item "All actions / Configure list".

The Conditional appearance tab.

We choose the required design and format.

We indicate the list of fields to which this design will be applied.