1

Is there any FO function for getting the weekday of an abas date as short. e.g.: Today: 07.04.2016 -> Thursday (th) ?

P4JS
  • 63
  • 4

2 Answers2

1

In example, when you have;

.type GD xddate                 ? _F|defined(U|xddate)
.type int xidate               ? _F|defined(U|xidate)
..
!START
.formula U|xddate = "."
.formula U|xidate = U|xddate//7
.println 'F|tostring(U|xidate)'

The variable U|xtdate will continue "4" which is the fourth day of the week, Thursday.

Frank
  • 163
  • 7
0

Another deeper approach would be, to get the name of the weekday from the built-in dictionary.

See in HOMEDIR/msg.cc.dic which number monday has (in my case 420) Then this FO-line

.type text xtweekday
.type GD xddate
.formula U|xddate = "09.04.2016"
.atext -language E xtweekday 'F|eval(420 + U|xddate//7)'

'xtweekday' returns Saturday

for "today" just write

.atext -language E xtweekday 'F|eval(420 + G|date//7)'

You can also use the more powerfull .translate command, but this is in this case not really necessary.

Alexander Baltasar
  • 1,044
  • 1
  • 12
  • 25