Jump to content

GUICtrlCreateDate Ignores AM/PM and setting random time >_<


Recommended Posts

it seems to read from ok but updating the date field seems jacked on two fronts - first the BEFORE isn't sending the right time at all..... the second example doesn't take account of the am/pm is something getting converted?

local $GUI = GuiCreate("",200,75)
local $testDate = GUICtrlCreateDate("2015/01/14 09:00:00 PM",15,20,90,20,9)


$val = GUICtrlRead($testDate)
GUIsetState(@SW_SHOW)


ConsoleWrite("testDate BEFORE (Should be 2015/01/14 09:00:00 PM): " & $val & @CRLF)

sleep(1000)

local $test = GUIctrlSetData($testDate,"2015/01/14 10:00:00 PM")
$val = GUICtrlRead($testDate)

ConsoleWrite("testDate AFTER (should be 2015/01/14 10:00:00 PM): " & $val & @CRLF)
While 1
   switch GUIgetMsg()
      Case -3
        Exit
   EndSwitch
WEnd

Don't let that status fool you, I am no advanced memeber!

Link to comment
Share on other sites

attempted HH:mm:ss (military time) to no avail:

local $testDate = GUICtrlCreateDate("2015/01/14 21:00:00",15,20,90,20,9)

testDate BEFORE (Should be 2015/01/14 21:00:00): 8:05:01 PM

 

EDIT: spoke to soon...it seems to take it ok as an update so will just work with that....

local $test = GUIctrlSetData($testDate,"2015/01/14 22:00:00")
$val = GUICtrlRead($testDate)

ConsoleWrite("testDate AFTER (should be 2015/01/14 22:00:00): " & $val & @CRLF) 
Log:
testDate AFTER (should be 2015/01/14 22:00:00): 10:00:00 PM
 
 
hopefully there is a time conversion function else will be a pita that reading yields AM/PM but writing has to be HH:mm:ss
Edited by MuffettsMan

Don't let that status fool you, I am no advanced memeber!

Link to comment
Share on other sites

You'll need to make the conversion between AM and PM yourself.

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

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...