PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | French EN
  • YYYYMMDD format
  • Miscellaneous
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Converts an integer into a date in YYYYMMDD format.
Versions 15 and later
Android This function is now available for Android applications.
New in version 15
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Versions 16 and later
Universal Windows 10 App This function is now available for Windows Phone applications.
New in version 16
Universal Windows 10 App This function is now available for Windows Phone applications.
Universal Windows 10 App This function is now available for Windows Phone applications.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 26 and later
Apple Watch This function is now available for Apple Watch applications.
New in version 26
Apple Watch This function is now available for Apple Watch applications.
Apple Watch This function is now available for Apple Watch applications.
Example
IntegerToDate(73773)       // Returns "20011225"
IntegerToDate(73773, "Y")  // Returns "2001"
IntegerToDate(73773, "M")  // Returns "12"
IntegerToDate(73773, "D")  // Returns "25"
 
// Calculate tomorrow's date
let Tomorrow = IntegerToDate(DateToInteger(DateSys()) + 1)
Syntax
<Result> = IntegerToDate(<Date> [, <Format>])
<Result>: Character string or Date variable
Date in YYYYMMDD format.
<Date>: Integer
Number of days elapsed since January 1st 1800 + 1 (January 1st 1800 is number 1).
<Format>: Optional character string
Format of the date to retrieve:
  • Y to retrieve the year in YYYY format,
  • M to retrieve the month in MM format,
  • D to retrieve the day in DD format.
If this parameter is not specified, the format used by default is YYYYMMDD (YYYY corresponds to the year, MM to the month and DD to the day).
Remarks

YYYYMMDD format

To get the date in a format other than YYYYMMDD, the string must be formatted using DateToString, Right, Left, etc.
The YYYYMMDD format was chosen because it allows you to check the order of dates. This would not be possible with a date in YYYYDDMM or DDMMYYYY format, for example.
WINDEVWEBDEV - Server codeReports and QueriesWindowsAndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows MobileJavaUser code (UMC)Stored procedures

Miscellaneous

This function cannot be used to retrieve dates before October 14, 1582 (the change from the Julian to the Gregorian calendar will not be taken into account).
Business / UI classification : Neutral code
Component : wd260std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Data Fora Feriado?
PROCEDURE Rules_DataForaFeriado(gData)

bDataForaFeriado is boolean = True

HReset(T031_FERIADOS)
FOR EACH T031_FERIADOS
IF HFound(T031_FERIADOS) = True
IF T031_FERIADOS.T031_DIA = Middle(gData,7,2) AND T031_FERIADOS.T031_MES = Middle(gData,5,2) THEN
bDataForaFeriado = False
END
END
END

IF bDataForaFeriado = False THEN
Info("A data é um feriado!")
END

RESULT bDataForaFeriado
BOLLER
03 Apr. 2019
Exemplo: A data é invalida pois é um domingo!!!!
PROCEDURE Rules_DataValida(dDataValida)
bvalida is boolean = False
dataFormatada is Date
dataFormatada..Year = Middle(dDataValida,1,4)
dataFormatada..Month = Middle(dDataValida,5,2)
dataFormatada..Day = Middle(dDataValida,7,2)
dDataMinima is Date
dDataMinima = dataFormatada
dDataMinima..Year -= 5
dDataMaxima is Date
dDataMaxima = dataFormatada
dDataMaxima..Year += 5
IF dataFormatada >= dDataMinima AND
dataFormatada <= dDataMaxima AND
Lower(DateToDayInAlpha(dataFormatada)) <> "domingo" AND
Lower(DateToDayInAlpha(dataFormatada)) <> "sábado"
bvalida = True
ELSE
bvalida = False
IF Lower(DateToDayInAlpha(dataFormatada)) = "domingo" OR
Lower(DateToDayInAlpha(dataFormatada)) = "sábado"
Info("Data Inválida, é um "+DateToDayInAlpha(dataFormatada)) ////
ELSE
Info("Data Inválida")
END
END
RESULT bvalida
BOLLER
03 Apr. 2019