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.
I use cp editor for inserting date and time
can you please share your whole code , i also use cpeditor but i have no idea on how to do it
go to options -> preferences -> competetive companion -> content of the head comments -> add this line there "${time}".
you need this extension to be installed.
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 yearCURRENT_YEAR_SHORT
The current year's last two digitsCURRENT_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 formatCURRENT_MINUTE
The current minute as two digitsCURRENT_SECOND
The current second as two digitsCURRENT_SECONDS_UNIX
The number of seconds since the Unix epoch