How to PRINT Calendar dates

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #255200 quote
    umrk
    Participant
    New

    I would like to print a date variable, say “20260109”   as “Friday 9 Jan 2026”. I have not managed to get this ! (all I get is “20M”, poor round up of 20260109 !)

    Je souhaite afficher une date, par exemple « 20260109 », au format « vendredi 9 janvier 2026 ». Je n’y parviens pas ! (J’obtiens seulement « 20M », un arrondi incorrect de 20260109 !)

    #255206 quote
    umrk
    Participant
    New

    Bon ça va je me suis débrouillé (il suffit de lancer l’impression au moment où le BarIndex correspond à la date qu’on veut imprimer (le seul inconvénient est qu’il faut le faire à ce moment là, et pas à un autre !)

    #255212 quote
    robertogozzi
    Moderator
    Master

    Vous voyez « 20M » car la date est traitée comme un nombre et affichée ainsi, car elle comporte trop de chiffres.

    Vous pouvez la décomposer en jours, mois et années comme ceci :

    myDate = OpenDate
    IF (myDate = 20260109) AND (myDate <> myDate[1]) THEN
       OdW     = OpenDayOfWeek
       myDay   = OpenDay
       myMonth = OpenMonth
       myYY    = OpenYear
       myCent  = floor(OpenYear / 100,0)
       myYear  = (OpenYear MOD 100)
       IF OdW = 0 THEN
          DrawText("#myDate# = Sun #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)
       ELSIF OdW = 1 THEN
          DrawText("#myDate# = Mon #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)
       ELSIF OdW = 2 THEN
          DrawText("#myDate# = Tue #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)
       ELSIF OdW = 3 THEN
          DrawText("#myDate# = Wed #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)
       ELSIF OdW = 4 THEN
          DrawText("#myDate# = Thu #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)
       ELSIF OdW = 5 THEN
          DrawText("#myDate# = Fri #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)
       ELSIF OdW = 6 THEN
          DrawText("#myDate# = Sat #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)
       ELSE
          DrawText("#myDate# = ??? #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)
       ENDIF
    ENDIF
    RETURN

    Ainsi, 2026 s’affichera sous la forme « 20 26 ». Si vous préférez l’afficher sans espaces, mais avec le séparateur de milliers, vous devez modifier le DRAWTEXT en remplaçant .#myCent##myYear# dans :

    .#myYY#
    umrk and Iván González thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

How to PRINT Calendar dates


Support Plateforme : Graphiques, Données & Courtiers

New Reply
Author
author-avatar
umrk @umrk Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by robertogozzi
1 month, 2 weeks ago.

Topic Details
Forum: Support Plateforme : Graphiques, Données & Courtiers
Language: French
Started: 01/11/2026
Status: Active
Attachments: No files
Logo Logo
Loading...