Formatting dates: Difference between revisions

From Planfix
Jump to: navigation, search
(Created page with "{{#seo: |title=Formatting dates |titlemode=append |keywords=Planfix, Formatting dates, dates, Formatt, date |description=Formatting dates }} Different variables can be used i...")
 
No edit summary
Line 12: Line 12:


Using the date July 3, 1996 at 2:14 PM as an example, the tables below provide patterns for formatting dates in variables.
Using the date July 3, 1996 at 2:14 PM as an example, the tables below provide patterns for formatting dates in variables.


{| class="wikitable"
{| class="wikitable"
Line 145: Line 144:
| style="text-align: center; font-weight: bold;" | Result
| style="text-align: center; font-weight: bold;" | Result
|-
|-
|<nowiki>{{Задача.Дата::ФорматироватьДату=dd/MM/yy}}</nowiki>
|<nowiki>{{Task.Date::FormatDate=dd/MM/yy}}</nowiki>
|03/06/96
|03/06/96
|-
|-
|<nowiki>{{Задача.Дата::ФорматироватьДату=dd MMM yyyy}}</nowiki>
|<nowiki>{{Task.Date::FormatDate=dd MMM yyyy}}</nowiki>
|03 июл. 1996
|03 Jul. 1996
|-
|-
|<nowiki>{{Задача.Дата::ФорматироватьДату=yyyy-MM-dd}}</nowiki>
|<nowiki>{{Task.Date::FormatDate=yyyy-MM-dd}}</nowiki>
|1996-06-03
|1996-06-03
|-
|-
|<nowiki>{{Задача.Дата::ФорматироватьДату=dd-MM-yyyy h:mm a}}</nowiki>
|<nowiki>{{Task.Date::FormatDate=dd-MM-yyyy h:mm a}}</nowiki>
|03-06-1996 2:14 AM
|03-06-1996 2:14 AM
|-
|-
|<nowiki>{{Задача.Дата::ФорматироватьДату=dd-MM-yyyy HH:mm:ss}}</nowiki>
|<nowiki>{{Task.Date::FormatDate=dd-MM-yyyy HH:mm:ss}}</nowiki>
|03-06-1996 14:14:28
|03-06-1996 14:14:28
|-
|-
|<nowiki>{{Задача.Дата::ФорматироватьДату=yyyy-MM-dd HH:mm:ss.SSS}}</nowiki>
|<nowiki>{{{Task.Date::FormatDate=yyyy-MM-dd HH:mm:ss.SSS}}</nowiki>
|1996-06-03 14:14:28.954
|1996-06-03 14:14:28.954
|-
|-
|<nowiki>{{Задача.Дата::ФорматироватьДату=yyMMddHHmmssSSS}}</nowiki>
|<nowiki>{{Task.Date::FormatDate=yyMMddHHmmssSSS}}</nowiki>
|960603141428954
|960603141428954
|-
|-
|<nowiki>{{Задача.Дата::ФорматироватьДату=EEEE, hh a}}</nowiki>
|<nowiki>{{Task.Date::FormatDate=EEEE, hh a}}</nowiki>
|среда, 02 PM
|Wednesday, 02 PM
|}
|}




== Важно ==
== Important ==
*Формат даты в переменной указывается только английскими буквами.
*Date formats in variables are specified using English words and letters.
*При вставке переменной типа ДАТА с форматированием в ячейку Excel к ней применяется форматирование. Если для переменной нет форматирования, то будет использоваться форматирование конечной ячейки. Ячейка, в которую вставляется форматирование, в конечном итоге будет типа ДАТА.
*When pasting a date variable with formatting in an Excel spreadsheet, formatting is applied. If there's no formatting for the variable, the formatting set for the cell will be used. Cells where formatting is pasted will be changed to date type.




== Перейти ==
== Go To  ==
*[[Переменные в шаблонах задач]]
*[[Variables in task templates]]  
*[[Переменные в шаблонах документов]]
*[[Variables in document templates]]
*[[Feature Description]]

Revision as of 08:27, 2 September 2022

Different variables can be used in Planfix task and document templates, including date and time variables. You can set the desired display format for these variables. The template for a variable with formatting looks as follows:

{{{Task.Date::FormatDate=Format}}, where Format is the date formatting template.


Using the date July 3, 1996 at 2:14 PM as an example, the tables below provide patterns for formatting dates in variables.

Format Description Examples
y year (4 digits) 1996
yy year (2 digits) 96
yyyy year (4 digits) 1996
M month without leading zero 7, 10
MM month with leading zero 07, 10
MMM abbreviated month Jul.
MMMM full month name July
d day of the month without leading zero 3, 15
dd day of the month with leading zero 03, 15
E Abbreviated day of the week Wed.
EEEE Full day of the week Wednesday
a AM / PM PM
H month in 24-hour format without leading zero 3, 14
HH чmonth in 24-hour format with leading zero 03, 14
h hour in 12-hour format 2
hh hour in 12-hour format 02
m minutes without leading zero 4, 30
mm minutes with leading zero 04, 30
s seconds 5, 55
ss seconds with leading zero 05, 55
S milliseconds (1 digit) 3
SS milliseconds (2 digits) 35
SSS milliseconds (3 digits) 359
L month without leading zero 7
LL month with leading zero 07
LLL month name July
w week number in year 27
W week number in month 1
D day of the year 185


Examples

The table below shows an example using a custom date field.

Variable Result
{{Task.Date::FormatDate=dd/MM/yy}} 03/06/96
{{Task.Date::FormatDate=dd MMM yyyy}} 03 Jul. 1996
{{Task.Date::FormatDate=yyyy-MM-dd}} 1996-06-03
{{Task.Date::FormatDate=dd-MM-yyyy h:mm a}} 03-06-1996 2:14 AM
{{Task.Date::FormatDate=dd-MM-yyyy HH:mm:ss}} 03-06-1996 14:14:28
{{{Task.Date::FormatDate=yyyy-MM-dd HH:mm:ss.SSS}} 1996-06-03 14:14:28.954
{{Task.Date::FormatDate=yyMMddHHmmssSSS}} 960603141428954
{{Task.Date::FormatDate=EEEE, hh a}} Wednesday, 02 PM


Important

  • Date formats in variables are specified using English words and letters.
  • When pasting a date variable with formatting in an Excel spreadsheet, formatting is applied. If there's no formatting for the variable, the formatting set for the cell will be used. Cells where formatting is pasted will be changed to date type.


Go To