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
GuiXT
Set V[mydate] "06.01.2018" // sample date, could be any date format
// convert to format dd.mm.yyyy
Set V[diff] "&V[mydate]" - "01.01.1900"
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[mydate] * 1
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
// in cases of multi language support we need to add the corresponding names
Set text[daysOfWeek] _
"Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday"
Set text[Q1] "January,February,March"
Set text[Q2] "April,May,June"
Set text[Q3] "July,August,September"
Set text[Q4] "October,November,December"
Set text[monthsOfYear] "&text[Q1],&text[Q2],&text[Q3],&text[Q4]"
// use CopyText to select the right name
CopyText fromText="daysOfWeek" toString="nameOfDay" _
line="&V[nDay]" delimiter=","
CopyText fromText="monthsOfYear" toString="nameOfMonth" _
line="&V[mm]" delimiter=","
// build up verbose date format
Set V[dd0] "&V[dd]" * 1 // no leading 0
Set V[verboseDate] "&V[nameOfDay], &V[nameOfMonth] &V[dd0], &V[yyyy]"
Message "&V[verboseDate]"