Returns the date in the PC's regional settings format.
#Include <date.au3>
_DateTimeFormat ( $sDate, $sType)
Parameters
$sDate | Input date in the format "YYYY/MM/DD[ HH:MM:SS]" |
$sType | 0 = Display a date and/or time. If there is a date part, display it as a short date. If there is a time part, display it as a long time. If present, both parts are displayed. 1 = Display a date using the long date format specified in your computer's regional settings. 2 = Display a date using the short date format specified in your computer's regional settings. 3 = Display a time using the time format specified in your computer's regional settings. 4 = Display a time using the 24-hour format (hh:mm). 5 = Display a time using the 24-hour format (hh:mm:ss). |
$iValToAdd | number to be added |
Return Value
Success: | Returns date in proper format. |
Failure: | 0 |
@Error: | 0 = No error. |
1 = Invalid $sDate | |
2 = Invalid $sType |
Remarks
None.
Related
None.
Example
#include <Date.au3>
; Show current date/time in the pc's format
MsgBox( 4096, "Pc Long format", _DateTimeFormat( _NowCalc(),1))
MsgBox( 4096, "Pc Short format", _DateTimeFormat( _NowCalc(),2))