PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
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
Returns the day corresponding to a given date.
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.
Example
DateToDay("20011225") // Returns 2
IF DateToDay(DateSys()) > 5 THEN
Info("It's the weekend")
END
Syntax
<Result> = DateToDay(<Date>)
<Result>: Integer
Number corresponding to the day of the week for the specified date:
1 - Monday
2 - Tuesday
3 - Wednesday
4 - Thursday
5 - Friday
6 - Saturday
7 - Sunday
<Date>: Character string, Date or DateTime variable
Date to use. This date can correspond to:
  • a character string in YYYYMMDD format (YYYY corresponds to the year, MM to the month and DD to the day).
  • Versions 24 and later
    a character string in YYYYMMDDHHMMSSCC format (YYYY corresponds to year, MM to month, DD to day, HH to hour, MM to minutes, SS to seconds and CC to hundredths of a second (use CCC for milliseconds). In this case, only the date is taken into account.
    New in version 24
    a character string in YYYYMMDDHHMMSSCC format (YYYY corresponds to year, MM to month, DD to day, HH to hour, MM to minutes, SS to seconds and CC to hundredths of a second (use CCC for milliseconds). In this case, only the date is taken into account.
    a character string in YYYYMMDDHHMMSSCC format (YYYY corresponds to year, MM to month, DD to day, HH to hour, MM to minutes, SS to seconds and CC to hundredths of a second (use CCC for milliseconds). In this case, only the date is taken into account.
  • a Date variable.
  • Versions 24 and later
    a DateTime variable. In this case, only the date is taken into account.
    New in version 24
    a DateTime variable. In this case, only the date is taken into account.
    a DateTime variable. In this case, only the date is taken into account.
Remarks
The storage format allows you to store dates from 01/01/0001 to 12/31/9999.
The calculations performed on dates by the WLanguage functions or by the WLanguage properties are accurate from January 1st 1583.
Related Examples:
Management of dates Unit examples (WINDEV): Management of dates
[ + ] Using the Date type of WLanguage and the functions for handling dates.
Component : wd240std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
video pegar dia semana
https://youtu.be/7Jfz3-Ly5xw
amarildo
20 Nov. 2018
Exemplo função dia da Semana
PROCEDURE funcao_dia_semana(d_recebe_data is Date)
s_dia_semana is string=""
SWITCH DateToDay(d_recebe_data)
CASE 1
s_dia_semana="SEGUNDA"
CASE 2
s_dia_semana="TERCA"
CASE 3
s_dia_semana="QUARTA"
CASE 4
s_dia_semana="QUINTA"
CASE 5
s_dia_semana="SEXTA"
CASE 6
s_dia_semana="SABADO"
CASE 7
s_dia_semana="DOMINGO"
OTHER CASE
END
RESULT(s_dia_semana)
//--------------------
d_recebe_data is Date=SAI_data_vencimento
SAI_dia_semana=funcao_dia_semana(d_recebe_data)
//-Blog com video e exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/01/curso-windev-datas-002-data-funcao-dia.html
De matos AMARILDO
02 Feb. 2016
Exemplo DateToDay
d_data_vencimento is Date=SAI_data_vencimento
(SAI_data_vencimento,SAI_diaSemana)=feriados_Calcula_proximo(d_data_vencimento)
//--------------
PROCEDURE feriados_Calcula_proximo(d_recebe_data is Date=0)
s_dia_semana is string=""
SWITCH DateToDay(d_recebe_data)
CASE 1
s_dia_semana="SEGUNDA"
CASE 2
s_dia_semana="TERCA"
CASE 3
s_dia_semana="QUARTA"
CASE 4
s_dia_semana="QUINTA"
CASE 5
s_dia_semana="SEXTA"
CASE 6
s_dia_semana="SABADO"
d_recebe_data..Jour-=1 // DAY
CASE 7
s_dia_semana="DOMINGO"
d_recebe_data..Jour+=1 // DAY

OTHER CASE
END
RESULT(d_recebe_data,s_dia_semana)

//Blog Com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/01/windev21-curso-230-calcular-dia-da.html

De matos AMARILDO
20 Jan. 2016