Faq/Calc/139/en

Problem
The functions TODAY and NOW calculate the current date and time automatically but, by definition, these values are automatically recalculated and are not "fixed".

Insertion using the keyboard
The simplest and quickest solution is to use the default key-bindings defined by:
 * to insert the date,
 * to insert the time.

In both cases the value contained in the cell is in the format dd/mm/yyyy hh:mm:ss. The default format applied is dd/mm/yy for the date and hh:mm:ss for the time respectively, when only the chosen part is displayed.

Insertion using the mouse
There are two possibilities: creating a dropdown list in the cell or using a "Calendar" control.


 * Dropdown list
 * Select the cell or range of cells concerned and go to 
 * On the Criteria tab, and the Allow listbox, choose Cell Range
 * In the Source box, type TEXT(TODAY;"JJ/MM/AA")

The formula TODAY returns the number corresponding to the date since the "origin" date, The formula TEXT presents this number in the desired format. The user can insert the date with one mouse-click:



Display the Form Controls toolbar. In this toolbar, click on "More Controls", then in this new toolbar, choose the tool Date field.
 * Calendar control


 * EN.FAQ_Calc_139_Insert_Date_Time_Fixed_2.png


 * 1) Draw the control
 * 2) Right-click on it and choose Control to display its properties
 * 3) On the General tab, define the property Dropdown to be Yes
 * 4) Click in the Form Controls toolbar on the second button from the left Design Mode On/Off

From now on, you will have a calendar by clicking on the arrow to scroll through the control.


 * EN.FAQ_Calc_139_Insert_Date_Time_Fixed_3.png

Note:
 * The input in the calender is not inserted into a cell.
 * There is a control called Hour but the latter does not "scroll" like the Date control. It does not therefore permit the current hour to be inserted with a single mouse-click.

Insertion using a timestamp formula
In this example the formula is entered in cell A1 and uses an Iterative Reference to cell B1.

Format cell A1 to the required date format with time.

From the main menu select .


 * EN.FAQ_Calc_139_Insert_Date_Time_Fixed_4.png

Click to set the Iterations checkbox and change the Steps to 1 (one).

In cell A1 enter the formula: =IF(B1<>"";NOW;"")

Enter some data in cell B1 and cell A1 will display the time stamp.

Note:
 * Editing or changing the contents of cell B1 at a later time will automatically update the time stamp in cell A1.