Jump to content

Date_Time_Convert - New version 17 Jun 23


Melba23
 Share

Recommended Posts

On 8/16/2023 at 12:02 AM, GMK said:

OK, I may have found the problem.  For If statements like the following:

EDIT:
Something is still not right, these changes break other parts of the UDF so I am retracting my post pending further investigation.


Good find, and an easy mistake to make.

I changed line 347, 392 (2 occurrences), 433 and 450 in DTC_Test.au3 but unfortunately it doesn't fix the issue I reported above where the "8:00 AM" time in string "July 9, 2023 8:00 AM" is still being output as ":00" instead of "08:00".

Edited by pseakins
typo. Retraction.

Phil Seakins

Link to comment
Share on other sites

  • Moderators

Hi guys,

Real life has been a bit complicated recently so I am only just beginning to look into the problems you have both reported. Sorry for the delay, but I should be able to work on the UDF in the very near future.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

4 hours ago, Melba23 said:

Real life has been a bit complicated recently so I am only just beginning to look into the problems you have both reported.

That's ok Melba, no hurry, I have a workaround. Thanks for all the work you do.

Edited by pseakins
typo

Phil Seakins

Link to comment
Share on other sites

  • Moderators

Hiya again,

I found the reason for pseakins' problem - the UDF was not internally converting 12hr hours into 24h hours because of a coding error on my part (incorrect array elements referenced).

This new code also works with GMK's problem code too, so I appear to have soved both problems with just the one change - very happy!

Both of you please try and break this new beta: 

M23

Edited by Melba23
Beta code removed

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

$sDate = 'August 18, 2023'
$sNewDate = _Date_Time_Convert($sDate, 'MMMM d, yyyy', 'yyyy-MM-dd HH:mm:ss')
If @error Then
  ConsoleWrite('@error = ' & @error & '; @extended = ' & @extended & @CRLF)
Else
  ConsoleWrite(StringFormat('%s = %s', $sDate, $sNewDate) & @CRLF)
EndIf

produces

August 18, 2023 = 2023-08-18 :**:**

I was expecting '**' placeholders for the 'HH' output as well?  (Just trying to "break the beta.")

Thanks for your time, @Melba23!

Link to comment
Share on other sites

  • Moderators

GMK,

Good spot!

 

 

M23

Edited by Melba23
Removed Beta code

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 3 months later...

https://www.autoitscript.com/forum/topic/154684-date_time_convert-new-version-17-jun-23/?do=findComment&comment=1523001

Hi @Melba23 The final DTC_Test.au3 beta posted above does not correctly convert 12:01 to 12:01 PM on my PC as demonstrated below. Is this still buggy or have I messed up my masks?

Cheers and Merry Xmas to all.

#include <MsgBoxConstants.au3>
#include "DTC.au3"

Global $sIn_Date, $sOut_Date

; This converts correctly to "Saturday, December 2, 2023 at 11:01 AM"
$sIn_Date = "2023/12/02 11:01:00"
$sOut_Date = _Date_Time_Convert($sIn_Date, "yyyy/MM/dd HH:mm:ss", "dddd, MMMM d, yyyy at h:mm TT")
MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date)

; This converts incorrectly to "Saturday, December 2, 2023 at 0:01 PM"
$sIn_Date = "2023/12/02 12:01:00"
$sOut_Date = _Date_Time_Convert($sIn_Date, "yyyy/MM/dd HH:mm:ss", "dddd, MMMM d, yyyy at h:mm TT")
MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date)

 

 

Phil Seakins

Link to comment
Share on other sites

  • Moderators

pseakins,

My bad - try this: DTC_Test.au3

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...