Modify

Opened 4 years ago

Closed 4 years ago

#2968 closed Feature Request (Completed)

Add mSeconds to _SetTime function

Reported by: anonymous Owned by: guinness
Milestone: 3.3.13.20 Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description

Add mSeconds also to "Date.au3" library in the function: _SetTime.

Attachments (0)

Change History (3)

comment:1 Changed 4 years ago by TicketCleanup

  • Version 3.3.12.0 deleted

Automatic ticket cleanup.

comment:2 in reply to: ↑ description Changed 4 years ago by anonymous

Replying to anonymous:

Add mSeconds also to "Date.au3" library in the function: _SetTime.

Func _SetTime($iHour, $iMinute, $iSecond = 0, $mSecond = 0)

;============================================================================
;== Some error checking
;============================================================================
If $iHour < 0 Or $iHour > 23 Then Return 1
If $iMinute < 0 Or $iMinute > 59 Then Return 1
If $iSecond < 0 Or $iSecond > 59 Then Return 1
If $mSecond < 0 Or $mSecond > 999 Then Return 1

Local $tSYSTEMTIME = DllStructCreate($tagSYSTEMTIME)

;============================================================================
;== Get the local system time to fill up the SYSTEMTIME structure
;============================================================================
DllCall("kernel32.dll", "none", "GetLocalTime", "struct*", $tSYSTEMTIME)
If @error Then Return SetError(@error, @extended, 0)

;============================================================================
;== Change the necessary values
;============================================================================
DllStructSetData($tSYSTEMTIME, "Hour", $iHour)
DllStructSetData($tSYSTEMTIME, "Minute", $iMinute)
If $iSecond > 0 Then DllStructSetData($tSYSTEMTIME, "Second", $iSecond);Alx
If $mSecond > 0 Then DllStructSetData($tSYSTEMTIME, "MSeconds", $mSecond);Alx

;============================================================================
;== Set the new time
;============================================================================
Local $iRetval = _Date_Time_SetLocalTime($tSYSTEMTIME)
If @error Then Return SetError(@error + 10, @extended, 0)

Return Int($iRetval)

EndFunc ;==>_SetTime

comment:3 Changed 4 years ago by guinness

  • Milestone set to 3.3.13.20
  • Owner set to guinness
  • Resolution set to Completed
  • Status changed from new to closed

Added by revision [11185] in version: 3.3.13.20

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain guinness.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.