General calendar
Summary
Adds a column to the table that contains calendar information such as weekday, month, year, day of the week, week of year in predefined or user-defined formats or (see date and time formats in Formatting strings).
The operator requires at least one column of the data type Date/Time.
Configuration
Input settings of existing table
Name | Value | Opt. | Description | Example |
---|---|---|---|---|
From | System.DateTime | - | This column contains the reference date/time for the calendar information. | - |
Settings
Name | Value | Opt. | Description | Example |
---|---|---|---|---|
Name of the result column | System.String | - | Name of the column to which the calendar information is saved | - |
Year | System.Boolean | - | Adds the year to the calendar information, formatted to | - |
Month | System.Boolean | - | Adds the month to the calendar information, formatted to | - |
Quarter | System.Boolean | - | Adds the quarter to the calendar information, either of | - |
Day | System.Boolean | - | Adds the day of the month to the calendar information, formatted to | - |
Weekday | System.Boolean | - | Adds the weekday number | - |
Weekday (abbreviation) | System.Boolean | - | Adds the weekday to the calendar information, formatted to | - |
Weekday - identifier | System.Boolean | - | Adds the weekday to the identifier text. | - |
Weekday (nth day in month) | System.Boolean | - | Adds the weekday and the | - |
Calendar day | System.Boolean | - | Adds the calendar day (n-th day of the year) to the calendar information. | - |
Calendar week | System.Boolean | - | Adds calendar week to the calendar information. | - |
Calendar week rule | System.String
| - | Defines the calendar week rule to be applied.
| - |
Free format | System.String | opt. | User-defined string with calendar information given one of the date/time formats in Formatting strings. | - |
Want to learn more?
Screenshot
Examples
Example: Get information to specific days
Situation | In this example we habe a column "Date" but we want more details to the specific days |
---|---|
Settings | |
Result | |
Project File | - |
Example: Only one date column
Situation | |
---|---|
Settings | |
Result | |
Project File | - |
Troubleshooting
Free format
- The symbol for day is d.
- The symbol for month is M.
- The symbol for minute is m.
- The symbol for two-digit year is yy.
For more information on formatting please refer to Grundbegriffe Formate
Performance Issues
Day of week
use Formula operator (row-by-row) (5.0) with following code snippet for a better performance:
((
int
)#Von#.DayOfWeek == 1) ?
"1;Montag"
:
((
int
)#Von#.DayOfWeek == 2) ?
"2;Dienstag"
:
((
int
)#Von#.DayOfWeek == 3) ?
"3;Mittwoch"
:
((
int
)#Von#.DayOfWeek == 4) ?
"4;Donnerstag"
:
((
int
)#Von#.DayOfWeek == 5) ?
"5;Freitag"
:
((
int
)#Von#.DayOfWeek == 6) ?
"6;Samstag"
:
"7;Sonntag"
Related topics
- Operators (alphabetical overview)
- For performance reasons it might be interesting to use a formula operator.
- Some things are straight forward #From#.ToString("HH:mm")
- Other are more complex:
new System.Globalization.GregorianCalendar().GetWeekOfYear(System.DateTime.Now,
System.Globalization.CalendarWeekRule.FirstFourDayWeek, System.DayOfWeek.Monday)