secs2date format

I thought this format returned the date format without any separators  ... but it doesn't 

textDate = secs2date(DT,-2,"")					// "YYYYMMDD"

What is the correct format for secs2date to obtain this format YYYYMMDD?

 

 

johnweeks

What you assume is quite reasonable- it should work that way. Looking at the source code shows that fixing it is surprisingly complicated, as the underlying code is used in a number of places, and we would have to be careful to make sure those other uses didn't break. I have entered a ticket for the change.

KZarzana

Edit: See John's comment above.

This will work:

textdate=ReplaceString("-", secs2date(DT,-2), "")

The Help says that if the separate str is omitted, then it defaults to "-", so my guess is that it's treating an empty string the same as an omitted string.  Perhaps one of the WaveMetrics folks can chime in. 

Mike German

OK John, I thought I'd had it working as expected some time ago.

Yes Kyle that is what I had done x2 to remove the hyphens - the lines can stay in the code when it is fixed.

johnweeks

The fix is in. Tomorrow's nightly build will honor an empty string as meaning there should be no separator character. Be sure you get a nightly build with a date after Aug. 12, 2026. As a small additional benefit, in the unlikely event that some situation makes it desirable, you can use more than one character as the separator.