How to PRINT Calendar dates
Forums › ProRealTime forum Français › Support plateforme ProRealTime › How to PRINT Calendar dates
- This topic has 2 replies, 2 voices, and was last updated 6 hours ago by
robertogozzi.
-
-
01/11/2026 at 9:45 AM #255200
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 !)
01/11/2026 at 4:08 PM #25520601/11/2026 at 9:27 PM #255212Vous 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 :
123456789101112131415161718192021222324252627myDate = OpenDateIF (myDate = 20260109) AND (myDate <> myDate[1]) THENOdW = OpenDayOfWeekmyDay = OpenDaymyMonth = OpenMonthmyYY = OpenYearmyCent = floor(OpenYear / 100,0)myYear = (OpenYear MOD 100)IF OdW = 0 THENDrawText("#myDate# = Sun #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)ELSIF OdW = 1 THENDrawText("#myDate# = Mon #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)ELSIF OdW = 2 THENDrawText("#myDate# = Tue #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)ELSIF OdW = 3 THENDrawText("#myDate# = Wed #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)ELSIF OdW = 4 THENDrawText("#myDate# = Thu #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)ELSIF OdW = 5 THENDrawText("#myDate# = Fri #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)ELSIF OdW = 6 THENDrawText("#myDate# = Sat #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)ELSEDrawText("#myDate# = ??? #myDay#.#myMonth#.#myCent##myYear#",BarIndex,high+range*2,dialog,bold,15) coloured("Blue",255)ENDIFENDIFRETURNAinsi, 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 :
1.#myYY#1 user thanked author for this post.
-
AuthorPosts
