Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

TaskCode
Calculate the number of years between FROM and TO while considering leap years
#To#.Year - #From#.Year - 1 +
(System.DateTime.ParseExact(System.Convert.ToString(#From#.Year + 1) +"0101","yyyyMMdd",null) - #From#).Days/
(System.DateTime.IsLeapYear(#From#.Year) && #From# <= System.DateTime.ParseExact(System.Convert.ToString(#From#.Year) +"0301","yyyyMMdd",null)? 366.0 : 365.0) + 
(#To#- System.DateTime.ParseExact(System.Convert.ToString(#To#.Year) +"0101","yyyyMMdd",null)).Days/
(System.DateTime.IsLeapYear(#To#.Year)  && #To# >= System.DateTime.ParseExact(System.Convert.ToString(#To#.Year) +"0301","yyyyMMdd",null)? 366.0 : 365.0)
Build time categories as text - e.g. 06:00 - 08:00, 08:00 - 10:00
(System.Math.Floor(#From#.Hour / #time_category_length_in_h#)*#time_category_length_in_h#).ToString("00") + ":" +
(System.Math.Floor(#From#.Minute / (#time_category_length_in_h# * 60 ))*#time_category_length_in_h# * 60).ToString("00") + " - " +
(System.Math.Floor(#From#.AddHours(#time_category_length_in_h#).Hour / #time_category_length_in_h#)*#time_category_length_in_h#).ToString("00") + ":" +
(System.Math.Floor(#From#.AddHours(#time_category_length_in_h#).Minute / (#time_category_length_in_h# * 60 ))*#time_category_length_in_h# * 60).ToString("00")
Scaling in 5'
#From#.AddMinutes(-#From#.Minute).AddMinutes( 5.0 * (double) System.Math.Floor(#From#.Minute / 5.0 )).AddSeconds(-#From#.Second)
Getting a Date that has the correct workday#Eingabe# == "Mo" ? (new System.DateTime(2022, 4, 11)) :
#Eingabe# == "Di" ? (new System.DateTime(2022, 4, 12)) :
#Eingabe# == "Mi" ? (new System.DateTime(2022, 4, 13)) :
#Eingabe# == "Do" ? (new System.DateTime(2022, 4, 14)) :
#Eingabe# == "Fr" ? (new System.DateTime(2022, 4, 15)) :
#Eingabe# == "Sa" ? (new System.DateTime(2022, 4, 16)) :
#Eingabe# == "So" ? (new System.DateTime(2022, 4, 17)) :(new System.DateTime(2022, 4, 11))


See also MSDN's DateTime