Author Topic: Alias question  (Read 67 times)

imtribble

  • Community Member
  • Posts: 42
  • Hero Points: 3
Alias question
« on: September 09, 2023, 12:12:52 pm »

I have an alias setup for a comment block creation and I've used the following for years as part of that block

%\m printtime #m/#d/#Y% %\t

what used to be inserted was
09/09/2023 7:01:22 AM

but now it shows as
09/09/2023 7: 01: 22 AM

It isn't a major issue at all. But is there a way to remove the space between the time parts?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6582
  • Hero Points: 511
Re: Alias question
« Reply #1 on: September 09, 2023, 12:54:08 pm »
I am not able to reproduce this. Although, I'm using Windows 10 and don't have access to Windows 11

On Windows, SlickEdit is using the GetTimeFormatW() function.

code looks like this:

Code: [Select]
    SYSTEMTIME  sysTime;
    sysTime.wYear = m_year;
    sysTime.wMonth = m_month;
    sysTime.wDay = m_day;
    sysTime.wHour = m_hours;
    sysTime.wMinute = m_minutes;
    sysTime.wDayOfWeek = m_dayOfWeek;
    sysTime.wSecond = m_seconds;
    sysTime.wMilliseconds = m_microseconds / 1000;
    wchar_t dateStr[100];
    int len = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &sysTime, 0, dateStr, sizeof(dateStr) / sizeof(wchar_t));
    if (len && dateStr[len - 1] == 0) --len;
    result.assign(dateStr, len);
    return (result);

I suspect if you run the above code, you will get your results with the extra spaces.
« Last Edit: September 09, 2023, 12:59:32 pm by Clark »