//create the date var date1 = new Date(); //cycle through all rt fields for( var i in CKEDITOR.instances){ rteditor = CKEDITOR.instances[i]; //check if this is the rtfield i need if( rteditor.name == '#{id:richTextField1}'){ rteditor.insertHtml("<br><p><--------" + date1.toLocaleDateString() + " : " + date1.toLocaleTimeString() + "-----------></p><br>") } }