Jump to content

Recommended Posts

Posted (edited)
  On 8/15/2023 at 2:02 PM, GMK said:

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

Expand  

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

Posted (edited)

Edit: Apparently I don't know what I'm doing like Melba23 does.

 

Edited by GMK
Removed edit
  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted (edited)
  On 8/17/2023 at 8:30 PM, 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.

Expand  

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

Edited by pseakins
typo

Phil Seakins

  • Moderators
Posted (edited)

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:

  Reveal hidden contents

 

Posted
$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!

  • Moderators
Posted (edited)

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:

  Reveal hidden contents

 

  • 3 months later...
Posted

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

  • Moderators
Posted

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:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

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