3

I want to adjust my Visualizer in Visual Studio 2017 via the Nativis file. There is an own class date, which should be displayed more nicely in the debugger.

<Type Name = "date">
        <DisplayString>"{1900 + ts.tm_year}-{1 + ts.tm_mon}-{ts.tm_mday}T{ts.tm_hour}:{ts.tm_min}:{ts.tm_sec}"</DisplayString>
</Type> 

my current code shows something like this for a date in the debugger:

2018-1-1T0:0:0

However, I would like to have leading zeros. So like this:

2018-01-01T00:00:00

Is there a way to do that?

Bowers
  • 836
  • 8
  • 20
  • 1
    I don't think so. I added https://developercommunity.visualstudio.com/idea/389777/add-ability-to-specify-c-style-formats-to-format-s.html which is a more general mechanism which could solve your issue – goneskiing Nov 22 '18 at 16:39
  • Actually maybe there is a work around using Conditions. For a struct with a year, month, day you can do – goneskiing Nov 22 '18 at 17:58
  • 1
    `{year}0{month}0{day}{year}0{(int)month}{day}{year}{month}0{day}{year}{month}{day}` Sorry but stackoverflow seems to reformat stuff – goneskiing Nov 22 '18 at 18:05

0 Answers0