KDoc Posted February 16, 2022 Share Posted February 16, 2022 Hi, Is there any function or script in Autoit which will return the current date time in a specific format that is indexable as follows: For example, for today's date of 02/16/2022 time 01:30:05 pm it will return 20220216133005? Thanks Kris Link to comment Share on other sites More sharing options...
Danp2 Posted February 16, 2022 Share Posted February 16, 2022 Have you seen this prior thread? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted February 16, 2022 Share Posted February 16, 2022 Hi @KDoc, I don't know a out of the box variant, but you requirement should be matched by that simple function: #include-once #include <Date.au3> ConsoleWrite(_GetCurrentDateTimeAs_YYYYMMDDHHMMSS() & @CRLF) Func _GetCurrentDateTimeAs_YYYYMMDDHHMMSS() Local Const $iStripAllWhitespaces = 8 Local $sDateTime = _NowCalc() $sDateTime = StringReplace($sDateTime, '/', '') $sDateTime = StringReplace($sDateTime, ':', '') Return StringStripWS($sDateTime, $iStripAllWhitespaces) EndFunc Is that enough or do you need it more dynamically? Best regards Sven ________________Stay innovative! ThurmanReynolds 1 Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
KDoc Posted February 16, 2022 Author Share Posted February 16, 2022 Perfect Sven. That worked great!! Thank you so much. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 16, 2022 Developers Share Posted February 16, 2022 Moved to the appropriate forum. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now