Блог пользователя ankitesh

Автор ankitesh, история, 19 месяцев назад, По-английски

Can someone help me how to set date and time in template without actually printing it in terminal? I want to update date and time of submission in template itself without priting it in terminal. I am using python language. It will help me to know the time of submission of code in my template code.

  • Проголосовать: нравится
  • -2
  • Проголосовать: не нравится

»
19 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

I use cp editor for inserting date and time

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    can you please share your whole code , i also use cpeditor but i have no idea on how to do it

    • »
      »
      »
      19 месяцев назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      go to options -> preferences -> competetive companion -> content of the head comments -> add this line there "${time}".

      you need this extension to be installed.

»
19 месяцев назад, # |
Rev. 6   Проголосовать: нравится +3 Проголосовать: не нравится

If you are using Visual Studio Code, first open User Snippets (by clicking the settings icon in the bottom left and you will see it), then choose python.json, or cpp.json, or any language you want..., then do like this

The instructions about user snippets are written very detailed here: Instructions

For inserting date and time:

CURRENT_YEAR The current year

CURRENT_YEAR_SHORT The current year's last two digits

CURRENT_MONTH The month as two digits (example '02')

CURRENT_MONTH_NAME The full name of the month (example 'July')

CURRENT_MONTH_NAME_SHORT The short name of the month (example 'Jul')

CURRENT_DATE The day of the month as two digits (example '08')

CURRENT_DAY_NAME The name of day (example 'Monday')

CURRENT_DAY_NAME_SHORT The short name of the day (example 'Mon')

CURRENT_HOUR The current hour in 24-hour clock format

CURRENT_MINUTE The current minute as two digits

CURRENT_SECOND The current second as two digits

CURRENT_SECONDS_UNIX The number of seconds since the Unix epoch