Smartsite SXML CopyCode image Copy Code
{buffer.set(dnr, datetime.getdayofweek((datetime.today())))}

<se:switch expression="buffer.get(dnr)" save="sfx" whitespace="remove">
    <se:case value="1">
        <se:text>st</se:text>
    </se:case>
    <se:case value="2">
        <se:text>nd</se:text>
    </se:case>
    <se:case value="3">
        <se:text>rd</se:text>
    </se:case>
    <se:case>
        <se:text>th</se:text>
    </se:case>
</se:switch>
<se:text>
    Today it's the {buffer.get(dnr)}-{buffer.get(sfx)} day of the week.<br />
    The current date/time (using {locale.getculture()} locale) is
     {locale.formatdatetime(datetime.now())}.
    <br />Using dutch notation:
     {locale.formatdatetime(datetime.now(),"nl-nl")}
     <p>Miscellaneous datetime viper examples:
     <br />- MinValue = {datetime.minvalue()}
     <br />- MaxValue = {datetime.maxvalue()}
     <br />- UtcNow = {datetime.utcnow()}
     </p>
</se:text>