skip to Main Content

xplan xmerge

Search
Generic filters
Exact matches only
Filter by Custom Post Type

Try these: client detailstasks syntaxsuperannuation

Date Formatting

Native dates in Xplan can be formatted by using the .format() argument with the parameters outlined below :

Setec Astronomy

<:=datetime_merge.format(‘%A, %d %B %Y’):>
<:=datetime_merge.format(‘%d/%m/%y’):>
<:=$client.dob.format(‘%d %B %Y):>

Parameters for .format()

Use the following parameters in the .format() argument to get the date to output as needed:

Parameter

Description

Syntax

%a Short Day Name (Fri) <:=datetime_merge.format('%a'):>
%A Long Day Name (Friday) <:=datetime_merge.format('%A'):>
%d Day as a number (zero padded) <:=datetime_merge.format('%d'):>
%b Short Month (Jun) <:=datetime_merge.format('%b'):>
%B Long Month (June) <:=datetime_merge.format('%B'):>
%m Month Number (zero padded) <:=datetime_merge.format('%m'):>
%y Short Year (19) <:=datetime_merge.format('%y'):>
%Y Full Year (2019) <:=datetime_merge.format('%Y'):>
%x Localised Date(20/10/19) <:=datetime_merge.format('%x'):>
%X Time without am/pm <:=datetime_merge.format('%X'):>
%H %M %S Timestamp (hour minute seconds) <:=datetime_merge.format('%H %M %S'):>
%p Time get am/pm <:=datetime_merge.format('%p'):>

Date Formatting Alternative

The following date formatting was added into Xplan back in versions 2.13.  While the standard python based formatting (above) has persisted as the dominant type used, the below can be useful for simple datetime merges – the enhanced formatting isn’t recognised by all datetime objects:

Setec Astronomy

<:=datetime_merge.format(‘dd MMMM YYYY’):>

Parameter

Description

Syntax

full Full date and time <:=datetime_merge.format('full'):>
full, True Full date no time <:=datetime_merge.format('full', True):>
long, True Long date no time (5 June 2019) <:=datetime_merge.format('long', True):>
medium, True/td> Medium date with locale dividers <:=datetime_merge.format('medium', True):>
short, True Short Date (05/06/2019) <:=datetime_merge.format('short', True):>
d Day number (leading zero removed) <:=datetime_merge.format('d'):>
dd Day number (zero padded) <:=datetime_merge.format('dd'):>
MMM Short Month (Jun) <:=datetime_merge.format('MMM'):>
MMMM Long Month (June) <:=datetime_merge.format('MMMM'):>
yy Short Year (19) <:=datetime_merge.format('yy'):>
yyyy Long Year (2019) <:=datetime_merge.format('yyyy'):>
d MMMM yyyy Common date (05 June 2019) <:=datetime_merge.format('d MMMM yyyy'):>

Remove zero padding

Using the standard formatting, the day will output zero padded which means the 5th day of the month would output as: 05.  To remove this so you just see 5:

Setec Astronomy

<:=datetime_merge.format(‘%d %B %Y’).lstrip(‘0’):>

See also

Back To Top