Opened 15 years ago
Closed 15 years ago
#1783 closed Bug (Duplicate)
_Date_Time_FileTimeToStr with parm 1 error
| Reported by: | thesnoW | Owned by: | Gary |
|---|---|---|---|
| Milestone: | Component: | Standard UDFs | |
| Version: | 3.3.6.1 | Severity: | None |
| Keywords: | Cc: |
Description
; |[0] - Month
; |[1] - Day
; |[2] - Year
; |[3] - Hour
; |[4] - Minutes
; |[5] - Seconds
; |[6] - Milliseconds
; |[7] - Day of week
Func _Date_Time_FileTimeToStr(ByRef $tFileTime, $bFmt = 0)
Local $aDate = _Date_Time_FileTimeToArray($tFileTime)
If @error Then Return SetError(@error, @extended, "")
If $bFmt Then
Return StringFormat("%04d/%02d/%02d %02d:%02d:%02d", $aDate[2], $aDate[1], $aDate[0], $aDate[3], $aDate[4], $aDate[5])
Else
Return StringFormat("%02d/%02d/%04d %02d:%02d:%02d", $aDate[0], $aDate[1], $aDate[2], $aDate[3], $aDate[4], $aDate[5])
EndIf
EndFunc ;==>_Date_Time_FileTimeToStr
;--------------------------------------------
Func _Date_Time_FileTimeToStr(ByRef $tFileTime, $bFmt = 0)
Local $aDate = _Date_Time_FileTimeToArray($tFileTime)
If @error Then Return SetError(@error, @extended, "")
If $bFmt Then
Return StringFormat("%04d/%02d/%02d %02d:%02d:%02d", $aDate[2], $aDate[0], $aDate[1], $aDate[3], $aDate[4], $aDate[5])
Else
Return StringFormat("%02d/%02d/%04d %02d:%02d:%02d", $aDate[0], $aDate[1], $aDate[2], $aDate[3], $aDate[4], $aDate[5])
EndIf
EndFunc ;==>_Date_Time_FileTimeToStr

duplicate of #1509