ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Date and time functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns or modifies the system date (date of the day defined on the current computer).
Remarks:
  • This function is equivalent to DateSys.
  • WEBDEV - Server code The system date corresponds to the date of the day defined on the server.
Example
Res = Today()   // Res = "20011225"
Res = DateToString(Today()) // Res = "25/12/2001"
Year = Left(Today(), 4)
// Year returns the current year (2001 for example)
WINDEVWEBDEV - Server codeReports and QueriesWindowsUser code (UMC)AjaxStored procedures
// Changes the system date and displays the new date
Today("20020101")
Info(Today())
Syntax

Getting the system date Hide the details

<Result> = Today()
<Result>: Character string or Date variable
System date in YYYYMMDD format (YYYY corresponds to the year, MM to the month and DD to the day).
WINDEVWEBDEV - Server codeReports and QueriesWindowsUser code (UMC)AjaxStored procedures

Modifying the system date Hide the details

Today(<New date>)
<New date>: Character string or Date variable
New system date in YYYYMMDD format (YYYY corresponds to the year, MM to the month and DD to the day).
Remarks
  • 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.
  • On all current systems, the year of the system date can be between 1920 and 2120.
  • Caution: To modify the system date, you must have the administrator rights on the current computer.
  • WEBDEV - Browser codeLinuxUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJavaPHP In this version, Today can only be used to return the system date (of the current computer or the computer where the browser is running).
  • AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst In simulation mode, the date of the PC is used. At runtime, the date of the mobile device is used.
Related Examples:
Popup calendar Unit examples (WINDEV): Popup calendar
[ + ] Using a calendar that can be used by the OpenPopup function.
The PopCalendar window is very useful in the applications containing date controls.
Indeed, the PopCalendar window allows you to choose a date visually.
The risk of error is reduced as the user can see the day of the week corresponding to the selected date.
Then, the date control is filled with the value returned by the PopCalendar window.
The Calendar control Unit examples (WINDEV): The Calendar control
[ + ] Four methods for using the Calendar control:
- Using the Calendar control found in the WINDEV toolbar
- Using CalendarOpen and CalendarPicker as well as CalendarSelect (multi-selection)
- Using ..CalendarButton
- Using BankHolidayAdd
Business / UI classification: Neutral code
Component: wd290std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Video Today
https://youtu.be/cCrtvvjfPrc

https://windevdesenvolvimento.blogspot.com/2019/04/dicas-2089-windev-mobile-data-26-today.html

// EDt_DATE // DATA HOJE

EDT_Date=Today()
amarildo
29 Apr. 2019

Last update: 06/22/2023

Send a report | Local help