KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Inserting a dynamic vs. static Date and Time into your 4D Write document
PRODUCT: 4D Write | VERSION: | PLATFORM: Mac & Win
Published On: March 14, 2003

Version: 6.7.x or higher

Inserting a dynamic vs. static Date and Time into your 4D Write document can be done easily with:

WR INSERT DATE AND TIME (area; dateFormat; timeFormat)

The command WR INSERT DATE AND TIME allows you to insert at the cursor location a reference that displays the dynamic date and/or time. If there is a current text selection in your document, it will be replaced with the inserted reference.

Keep in mind the meaning of the word "dynamic." This means that when the date or time changes, the inserted date and time will reflect the changes.

If you want to insert a date or time that will remain static, you'll need to do something like this:

$time:=string(current time;1)
WR INSERT TEXT (Write_area; $time)
$date:=string(current date;1)
WR INSERT TEXT (Write_area; $date)

For more information, please view :
https://ftp.4d.com/aci_Technical_notes/ACIDOC/CMU/CMU89195.HTM
https://ftp.4d.com/aci_Technical_notes/ACIDOC/CMU/CMU89435.HTM