Hello,
To get the alignment, I had to create three \vbox. Can we simplify this code a bit ?
Thank you
Fabrice

% macros=mkvi
\setuplayout
   [header=3\lineheight,
    headerdistance=\lineheight]

\setupbackgrounds[header][text]
                 [frame=off,
                  bottomframe=on,
                  framecolor=darkgray,
                  rulethickness=2pt]

\defineframed[headerframedleft]
             [frame=off,
              align=left,
              width=fit,height=\headerheight]
   
\defineframed[headerframedright]
             [frame=off,
              align=right,
              width=fit,height=\headerheight]
   
\defineframed[headerframedmiddle]
             [frame=off,
              align=middle,
              width=fit,height=\headerheight]

\starttexdefinition MyHeader #where #day #month #year #title #number #time

\setupheadertexts
   [\headerframedmiddle{\\ \ss\sc\bf\red #title n\high{o}\,#number \\ }]
      
\setupheadertexts
   [\headerframedright{\tfx \ss Lycée JANSON DE SAILLY \\ \date[d=#day,m=#month,y=#year]}]
   [\headerframedleft{\tfx\ss #where \\ {#time}}]
   
\stoptexdefinition
 
\MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}

\starttext
\input knuth
\stoptext