Purpose Display a date in a verbose format, including the day of the week and name of month The next tip shows a solution via a VB .NET function |
Solution Set V[mydate] "06.01.2018" // sample date, could be any date format // convert to format dd.mm.yyyy Set V[d1] "01.01.1900" + "&V[diff]" Set V[dd] "&V[d1](1-2)"Set V[mm] "&V[d1](4-5)" Set V[yyyy] "&V[d1](7-10)" // calculate day of week 1=Monday,... 7=Sunday Set V[absdate] &V[absdate] + 4 Set V[nDay] &V[absdate] / 7 decimals=0 Set V[nDay] &V[nDay] * 7 Set V[nDay] &V[absdate] - &V[nDay] Set V[nDay] &V[nDay] + 4 // weekday and month names "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday" Set text[monthsOfYear] _ "January,February,March,April,May,June,July,August,September,October,November,December" // use CopyText to
select the right name CopyText fromText="monthsOfYear" toString="nameOfMonth" line="&V[mm]" delimiter=","
// build up verbose date
format Message "&V[verboseDate]" |
Components |