Home > OS >  Add current time to debug configuration in VS Code
Add current time to debug configuration in VS Code

Time:03-16

Is it possible to add the current time to debug configuration in Visual Studio Code? For example:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Run Module with Time",
            "type": "python",
            "request": "launch",
            "module": "my_module",
            "args": [
                "-time",
                "CURRENT TIME",

            ]
        }
    ]
}

CodePudding user response:

You can use the extension Command Variable and use the command extension.commandvariable.dateTime (see example 3 in the link). You have to use an ${input:XXXX} variable because of the passed arguments.

CodePudding user response:

check this code example it's working in my case

    "date: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE
     $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
  • Related