PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • YYYYMMDD format
  • Various
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
Transforms an integer into a date in YYYYMMDD format.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This function is now available for the Windows Phone applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the 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.
Example
IntegerToDate(73773)       // Returns "20011225"
IntegerToDate(73773, "Y")  // Returns "2001"
IntegerToDate(73773, "M")  // Returns "12"
IntegerToDate(73773, "D")  // Returns "25"

// Calculate tomorrow's date
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 passed since January 1st 1800 + 1 (January 1st 1800 is number 1).
<Format>: Optional character string
Element 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 by DateToString, Right, Left, etc.
The YYYYMMDD format was chosen because it allows you to check the chronology between two dates while this would not be possible with a date in YYYYDDMM format or in DDMMYYYY format for example.
WINDEVWEBDEV - Server codeReports and QueriesWindowsAndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 AppJavaUser code (UMC)Stored procedures

Various

You cannot use this function to retrieve dates older than October 14 1582 (the switch between the Julian and Gregorian calendar would not be taken into account).
Component : wd240std.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