Returns a formatted date and time based on a given format.

$(EDTIME, time, format-phrase)


time: the real number representing the Julian date. (supplying 0  will return the current date and time)
format-phrase: specifies how the date and time should be displayed, as illustrated by the following table


Assuming the date is 2009 March 04 09:37:06

Format phrase Result
D 4
DD 04
DDDD Wednesday
M 3
MM 03
YY 09
YYYY 2009
H 9
HH 09
MM 37
SS 06
a/p a


Code Returns
$(edtime,$(getvar,date),H:MMam/pm) 09:37am
$(edtime,$(getvar,date),DDD"," DD-MO-YY) Wed 04-03-09
$(edtime,$(getvar,date),DDD"," D MON"," YYYY) Wed, 4 Mar 2009

When format phrase contains text that Diesel cannot interpret, it is displayed literally (e.g. a space, a colon(:)). To use a comma (,) within the format phrase, quote it "," so that Diesel does not read the comma as an argument separator. If any of the “AM/PM” phrases appear in the format phrase, the “H” and “HH” phrases will edit the time according to the 12 hour civil clock (12:00–12:59—1:00–11:59) instead of the 24 hour clock (00:00–23:59)

Supplying 0 as time value will return the current date and time. This avoids the call on $(getvar,date).

Code Returns
$(edtime,0,H:MMam/pm) 09:37am
$(edtime,0,DDD","DD-MONTH-YYYY) Wed, 4-March-2009

See also...

DIESEL functions
© Bricsys NV. All rights reserved.