CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.093.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator. New AutoCAD 2026 commands and variables.

CAD tip CAD tip # 14363:

Question

CAD 
 %  platform  category 
A
AutoCAD offers several methods to insert text with today's date into a DWG drawing (see e.g. Tip 6366).

But how to insert a dynamic date "yesterday", "tomorrow", "two days ago", "a week ago", "six months ago", "a month ago", etc. into the drawing?

The DATE variable will help in this. It stores the time as a Modified Julian Date (aka "UT1"), as a decimal number (1 day is 1.00). Days and hours are counted from 12:00 AM on January 1, 4713 BC.

In combination with a DIESEL expression, you can then use simple calculations in FIELD to create derived dates related to "now", i.e. today.

E.g.:

$(edtime,$(-,$(getvar,date),1),D.MONTH YYYY - hh:mm)

displays the date "1 day less" (= yesterday), in the format 2.January 2025 - 07:44.

And similarly:

$(edtime,$(+,$(getvar,date),7),D.MONTH YYYY - hh:mm)
$(edtime,$(+,$(getvar,date),365),D.MO.YYYY)

represents the date "in a week", resp. "in a year", etc.

The red underlined part specifies arithmetic operations with the date, the blue underlined part specifies the format of the date display.

You can even use conditional DIESEL expressions, e.g. to highlight overdue terms:

Due date: $(if,$(>,$(getvar,date),2460679.0),"OVERDUE",$(edtime,$(-,$(getvar,date),1),D.M.YYYY - hh:mm))

ACADACADMPlantCivil3DACADEACLT
100% *CAD
3.1.2025    1693×  
Share the tip:
Digg it! Del.icio.us Facebook Twitter Google bookmark Technorati StumbleUpon

See also:
Tip 14414:Link geo-tagged photos from your mobile phone to AutoCAD DWG maps.
Tip 14142:When I save a DWG drawing in AutoCAD 2024 for Mac, the file creation date changes to 1970.
Tip 13868:XrefStamp - create a dynamic list of xrefs in your DWG drawing.
Tip 13513:How to quickly record a video from a CAD application or other Windows program? (replacing Screencast)
Tip 13459:DWG drawing version history directly in AutoCAD.


Back    All CAD Tips



Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD: 
OS: 
Categ: 
Text:
 FAQ
  



Featuring:
Export 3D VRML scenes from AutoCAD and Inventor
VRMLout More info


Please use these tips at your own risk.
ARKANCE is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist