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
System.DateTime To DEPRECATED System.DateTimeName Value Opt. Description Example From - This column contains the reference date/time for the calendar information. - opt. The To column of the input table. -
Settings
Name of the identifier column DEPRECATED System.String System.Boolean System.Boolean System.Boolean System.Boolean System.Boolean System.Boolean System.Boolean System.Boolean System.Boolean System.Boolean Adds calendar week to the calendar information. System.String Defines the calendar week rule to be applied. System.StringName Value Opt. Description Example - Name of the column to which the calendar information is saved - Year - Adds the year to the calendar information, formatted to yyyy
- Month - Adds the month to the calendar information, formatted to MM
- Quarter - Adds the quarter to the calendar information, either of 1
, 2
, 3
, or 4
- Day - Adds the day of the month to the calendar information, formatted to dd
- Weekday - Adds the weekday number n
and weekday name to the calendar information, formatted to ndddd
- Weekday (abbreviation) - Adds the weekday to the calendar information, formatted to ddd
- Weekday - identifier - Adds the weekday to the identifier text. - Weekday (nth day in month) - Adds the weekday and the n
-th occurrence of the weekday in the respective month to the calender information, formatted to n;
dddd
- Calendar day - Adds the calendar day (n-th day of the year) to the calendar information. - Calendar week - - Calendar week rule - - Free format opt. User-defined string with calendar information given one of the date/time formats in Formatting strings. -
Want to learn more?
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) = Formeloperator 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)