Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/25/2025 in Posts

  1. For me as well ! The regional settings for Germany are fine ! "Thanks" to the post with the patch from @ioa747 added.
    2 points
  2. #include <Date.au3> #include <SQLite.au3> #include <Debug.au3> ; Show current date/time in the pc's format Exit _DateTimeFormat_Compare() Func _DateTimeFormat_Compare() Local $aArray[10][8] $aArray[0][0] = " | 0 - date and/or time." $aArray[0][1] = " | 1 - long date, regional settings." $aArray[0][2] = " | 2 - short date, regional settings." $aArray[0][3] = " | 3 - time, regional settings." $aArray[0][4] = " | 4 - time 24-hour (hh:mm)." $aArray[0][5] = " | 5 - time 24-hour (hh:mm:ss)." $aArray[0][6] = " | 6 - time AM/PM (hh:mm tt)." $aArray[0][7] = " | 7 - time AM/PM (hh:mm:ss tt)." _DateTimeFormat_Test($aArray, _NowCalc(), @extended) _DateTimeFormat_Test($aArray, "2025/12/31 11:59:59", @extended) _DateTimeFormat_Test($aArray, "2025/12/31 23:59:59", @extended) _DateTimeFormat_Test($aArray, "2025/12/31 11:59:59 AM", @extended) _DateTimeFormat_Test($aArray, "2025/12/31 11:59:59 PM", @extended) ReDim $aArray[@extended + 1][8] Local $sArray = _SQLite_Display2DResult($aArray, 0, True) ConsoleWrite($sArray) ClipPut($sArray) ; to share in the forum if there is an error _DebugArrayDisplay($aArray, "_DateTimeFormat()") EndFunc ;==>_DateTimeFormat_Compare Func _DateTimeFormat_Test(ByRef $aArray, $sNowCalc, $iRow = 0) For $n = 0 To 7 $aArray[$iRow + 1][$n] = " | " & _DateTimeFormat($sNowCalc, $n) Next Return SetError(0, $iRow + 1, "Testing, testing. 1, 2, 3.") EndFunc ;==>_DateTimeFormat_Test Lets call this script "the golden test", so that we can share results. Makes sense to report failures only as otherwise we would be spamming the living out of the forum. If it all worked well, ... add a like/thanks to the post with the patch to show you tested it and worked as expected. | 0 - date and/or time. | 1 - long date, regional settings. | 2 - short date, regional settings. | 3 - time, regional settings. | 4 - time 24-hour (hh:mm). | 5 - time 24-hour (hh:mm:ss). | 6 - time AM/PM (hh:mm tt). | 7 - time AM/PM (hh:mm:ss tt). | 9/25/2025 12:19:48 PM | Thursday, September 25, 2025 | 9/25/2025 | 12:19:48 PM | 12:19 | 12:19:48 | 12:19 PM | 12:19:48 PM | 12/31/2025 11:59:59 AM | Wednesday, December 31, 2025 | 12/31/2025 | 11:59:59 AM | 11:59 | 11:59:59 | 11:59 AM | 11:59:59 AM | 12/31/2025 11:59:59 PM | Wednesday, December 31, 2025 | 12/31/2025 | 11:59:59 PM | 23:59 | 23:59:59 | 11:59 PM | 11:59:59 PM | 12/31/2025 11:59:59 AM | Wednesday, December 31, 2025 | 12/31/2025 | 11:59:59 AM | 11:59 | 11:59:59 | 11:59 AM | 11:59:59 AM | 12/31/2025 11:59:59 PM | Wednesday, December 31, 2025 | 12/31/2025 | 11:59:59 PM | 23:59 | 23:59:59 | 11:59 PM | 11:59:59 PM This report may look ugly in the browser but you can copy it and paste it to an editor and it'll look as intended. It looks good to me. If after peer review there are no complains ( say: a month ), it'll go into beta. Thanks @ioa747 Also, it'll need the help file adjustments to explain it's functionality ( important )
    2 points
  3. Wanted something more, added ... ; If $sType < 0 Or $sType > 5 Or Not IsInt($sType) Then If $sType < 0 Or $sType > 7 Or Not IsInt($sType) Then ... Case 6 If $asTimePart[0] > 1 Then $sTempTime = "hh:mm tt" EndIf Case 7 If $asTimePart[0] > 1 Then $sTempTime = "hh:mm:ss tt" EndIf ... If (StringInStr($sDate, 'pm') > 0) Or (StringInStr($sDate, $sPM) > 0) Then If $asTimePart[1] < 12 Then $asTimePart[1] += 12 ElseIf (StringInStr($sDate, 'am') > 0) Or (StringInStr($sDate, $sAM) > 0) Then If $asTimePart[1] = 12 Then $asTimePart[1] = 0 EndIf ... $sDate Input date in the format "YYYY/MM/DD[ HH:MM:SS[ tt]]" ... 4 - Display a time using the 24-hour format (hh:mm). (conversion from am/pm format). 5 - Display a time using the 24-hour format (hh:mm:ss). (conversion from am/pm format). 6 - Display a time using the am/pm format (hh:mm tt). 7 - Display a time using the am/pm format (hh:mm:ss tt). completed New version arrive
    2 points
  4. Open the helpfile and look at GUI event mode: "Advanced Operations and Multiple Windows", read, try and come back when you have issues with it.
    1 point
  5. and a portable one, to be available ConsoleWrite("- " & _Time12hTo24h('08:70 PM') & @CRLF) ; -2 ConsoleWrite("- " & _Time12hTo24h('08:30 PM') & @CRLF) ; 20:30 ConsoleWrite("- " & _Time12hTo24h('12:00 AM') & @CRLF) ; 00:00 ConsoleWrite("- " & _Time12hTo24h('12:00:44 PM') & @CRLF) ; 12:00:44 ConsoleWrite("- " & _Time12hTo24h('7:5 pm') & @CRLF) ; 19:05 ConsoleWrite("- " & _Time12hTo24h('7:5 am') & @CRLF) ; 07:05 ConsoleWrite("- " & _Time12hTo24h('08:30') & @CRLF) ; 08:30 Func _Time12hTo24h($sTime) Local $sNewTime = StringStripWS($sTime, 8) Local Const $bPM = (StringInStr($sNewTime, 'pm') > 0) $sNewTime = StringReplace($sNewTime, "pm", "") $sNewTime = StringReplace($sNewTime, "am", "") Local $aTime = StringSplit($sNewTime, ':') If $aTime[0] < 2 Then Return SetError(1, 0, -1) Local $iHour, $iMin, $iSec $iHour = Number($aTime[1]) $iMin = Number($aTime[2]) If $iHour < 0 Or $iHour > 12 Then Return SetError(2, 0, -2) If $iMin < 0 Or $iMin > 59 Then Return SetError(2, 0, -2) If $bPM And $iHour < 12 Then $iHour += 12 If Not $bPM And $iHour = 12 Then $iHour = 0 $sNewTime = StringFormat("%02i:%02i", $iHour, $iMin) If $aTime[0] >= 3 Then $iSec = Number($aTime[3]) If $iSec < 0 Or $iSec > 59 Then Return SetError(2, 0, -2) $sNewTime &= StringFormat(":%02i", $iSec) EndIf Return $sNewTime EndFunc ;==>_Time12hTo24h
    1 point
  6. @water... I'll get me some cafe, take a walk, ..something. I edited my post above. I took everything out of context. My brain is hooked on a work project and I can not do more than one thing at the time Ok. That addition to the Date.au3 UDF, was right there for the taking. All I did was to add the strings for options 6 and 7 ... Case 6 If $asTimePart[0] > 1 Then $sTempTime = "hh:mm tt" EndIf Case 7 If $asTimePart[0] > 1 Then $sTempTime = "hh:mm:ss tt" EndIf ... Now including the AM/PM to it, ...I'll need to be in a happy place ( no pressure ) to get my brain in gear for that. Now any and every one, is welcomed to present a _DateTimeFormat() that includes that. I'll ( well, the MVPs ) will look at it and say "yey/ney". Remember ( not just you ), that all these UDFs were scripts users of the forum coded and expanded with the participation of everyone. Don't be shy. Your nationforum needs you !. ( nowalways recruiting coders )
    1 point
  7. Here is a fun example that does the smooth color animation for the border and for the blur behind blend color as well. Mesmerizing! 🤩
    1 point
  8. Released v1.1.0 yesterday! Added Support for running the Format Document command via the Command Palette or hotkey using Tidy.exe on scripts, including automatic formatting on save Jest testing framework with test suite for language features and services Changed Refactored monolithic command code Upgraded build toolchain Diagnostic system overhaul with encoding handling and problem script source tracking Fixed Restored Go to Definition functionality for symbols declared outside of current script Restored Open Include file (Alt+i) functionality Path handling improvements Completion provider accuracy with user-defined functions View and Rate on VSCode Marketplace View and Rate on OpenVSX Star, Submit Issues, and Contribute on GitHub
    1 point
×
×
  • Create New...