One option is to use a shell script or Python/Perl/Ruby script.
One option, using Python:
t = time.localtime()
# yyyy-mm-dd hh:mm:ss
print '%d-%02d-%02d %02d:%02d:%02d' % (t.tm_year, t.tm_mon, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec)
Another, shorter, by @NReilingh, using
date (shell script):
date "+%Y-%m-%d %T"
/Applications/Automator.app to create a Service that executes this script. Add the Run Shell Script Automator action and insert the code above. Select no input in any application and replaces selected text. Then save.
It will be placed in the Services menu which is accessible from any application's menu bar by selecting the menu with the application's name. It might look something like this when you use it:
Assign keyboard shortcuts in the Keyboard preference pane in System Preferences.
The no longer free TextExpander has a feature similar to what you want. It's an application designed for snippet insertion, e.g. for partial email templates.
TextMate is an extensible, commercial editor that allows you to easily define custom commands, again in shell or scripting languages, and assign keyboard shortcuts to them.