Jump to content
LoneWolf_2106

_DateTimeSplit - Only date?

Recommended Posts

LoneWolf_2106

Hi,

i am trying to separate a date(day, month, year).

I like _datetimesplit, but it requires also the time(which i don't have).

Is there any similar function to split just the date?

 

Share this post


Link to post
Share on other sites
LoneWolf_2106

alright!

Thanks Jos

Share this post


Link to post
Share on other sites
Chimp

In the  _datetimesplit function, the time part is not mandatory
if you pass a string with only the date part, the function will populate the $aMyDate array with the splitted parts of the date, while the $aMyTime array will be simply left as 4 empty elements.


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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

  • Similar Content

    • litlmike
      By litlmike
      I am taking a Date & Time and splitting them using _DateTimeSplit, so that I can create a filename in the format: YYYYMMDD_HHMMSS.jpg.  The only issue is that if the month, or day, is a two-digit number that begins with a zero (so less than 10), then the month, or day, is formatted as a single-digit number.  Suggestions on how to accomplish this?
      Example:
      20180101 becomes 2018, 1, 1
      20180303 becomes 2018, 3, 3
      20180505 becomes 2018, 5, 5
      20180606 becomes 2018, 6, 6
      20180909 becomes 2018, 9, 9
      What I want:
      20180101 becomes 2018, 01, 01
      20180303 becomes 2018, 03, 03
      20180505 becomes 2018, 05, 05
      20180606 becomes 2018, 06, 06
      20180909 becomes 2018, 09, 09
      Func _CreateFileNameFromDateTimeFormat($sDateThatWasChangedIntoDateTimeFormat = "2018/01/02 10:29:39") Local $aMyDate, $aMyTime, $sNewImageFileName _DateTimeSplit($sDateThatWasChangedIntoDateTimeFormat, $aMyDate, $aMyTime) _ArrayDisplay($aMyDate) _ArrayDisplay($aMyTime) ;This will become file name $sNewImageFileName = $aMyDate[1] & $aMyDate[2] & $aMyDate[3] & "_" & $aMyTime[1] & $aMyTime[2] & $aMyTime[3] & ".jpg" ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sNewImageFileName = ' & $sNewImageFileName & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console EndFunc ;==>_CreateFileNameFromDateTimeFormat  
       
×