Search the Community
Showing results for tags '_datetimesplit'.
-
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
-
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?