Jump to content
Sign in to follow this  
Shedunn

Date and Time without punctuation

Recommended Posts

I've been looking through some different functions(not sure if that's the right word) to get the Date and time and I can't find one that doesn't include "/ " or ":" in what is returned.

I'm trying to create a file name with this format "QuickConfig_MMDDYYYY_HHMM"  (doesn't matter if 24 or 12hr format)

#include <Date.au3>

Func _SaveConfig
    
    MouseClick('primary',155, 46, 1, 0) ;clicks save as
    WinWait('Save bluePRINT Configuration As...','', 4)
    MouseClick('primary',632, 47, 1, 0) ;clicks the file path bar
            $Documents = @MyDocumentsDir
            $FilePath = $Documents & '\BP3 Configs'
                Send($FilePath)
                Send('{ENTER}')
    MouseClick('primary',166, 580, 1, 0) ;clicks file name bar
            $FileName = 'QuickConfig_' & _NowDate & '_' & _NowTime
            Send($FileName)
            Send('{ENTER}')
EndFunc

 

 

I'm wondering if there is a function somewhere to do this?

Share this post


Link to post
Share on other sites

Just use the various macros perhaps?

Quote

$sFileName = "QuickConfig_" & @MON & @MDAY & @YEAR & "_" & @HOUR & @MIN
ConsoleWrite($sFileName & @CRLF)

 


"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

I just realized the macros existed after reading another post

and I tried this 

$FileName = 'QuickConfig_' & @MDAY & '-' & @MON & '-' & @YEAR & '_' & @HOUR & @MIN

 

Works! Thank you

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Jahar
      Hi All,
      Please help me on how to fetch date/time of last windows 10 system restore point using autoit? Basically its about querying the last restore point.
    • By TheDcoder
      Hi everyone,
      I am bit stumped as to why I am not able to set the time in the Date control
      #include <DateTimeConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() GUICreate("My GUI get date", 200, 200, 800, 200) Local $idDate = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20, $DTS_TIMEFORMAT) ; to select a specific default format Local $sStyle = "HH:mm:ss" GUICtrlSendMsg($idDate, $DTM_SETFORMATW, 0, $sStyle) ; Set time Local $iRet = GUICtrlSetData($idDate, '13:33:37') ConsoleWrite('GUICtrlSetData returned ' & ($iRet = 1 ? 'success' : 'failure') & @CRLF) GUISetState(@SW_SHOW) ; Loop until the user exits. While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd MsgBox($MB_SYSTEMMODAL, "Time", GUICtrlRead($idDate)) EndFunc ;==>Example The documentation for GUICtrlSetData clearly mentions that it uses the same format as GUICtrlRead:
      But I get failure
      What gives?
      Thanks for the help in advance!
    • By Colduction
      Hi guys, i want to convert WebKit/Chrome timestamps that i've found in chrome cookie database to Human-Readable time (if possible, with UTC or GMT offset).
      Example of WebKit/Chrome timestamp: 13228999534132232 Output that i want: 2020-03-18 20:16:56 This site has a tool to do this work, but i wonder how to convert this time (this timestamp's time bases are 1600/01/01) to human-readable time:
      https://www.epochconverter.com/webkit
×
×
  • Create New...