I know we can get the start time of the batch via DMVs. I am looking to find the start time of the current command in a batch via DMV or some system table. This information can be seen via the Profiler, but I do not know how to get this via T-SQL.
Basically, you need to set up an event, run your batch then extract the event info.
Note that Profiler uses traces [Traces]
but Events are lighter weight and designed to replace traces.
return date in the command
execute the command using XP_cmdshell
This will give you the command output
I believe the two dmvs in the following article will do it for you.