Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I want to get the time when a notebook is created and the time when the notebook is saved and closed, that is to say, the whole time when a notebook exist. What should I do? Thank you!

share|improve this question
    
NotebookInformation[] might be useful. –  cormullion Dec 18 '13 at 12:10
add comment

1 Answer 1

Here are some basic steps you could use. Create a new notebook using this command:

CreateDocument[{
   ExpressionCell[creationtime = DateList[]];,
   ExpressionCell[Defer[
     NotebookSave[];
     NotebookClose[];
     closetime = DateList[]], "Input"]},
  NotebookFileName -> FileNameJoin@Append[
     FileNameSplit@$InitialDirectory, "new.nb"]];

Close the notebook using the created cell. Then you have creation and close times.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.