Putting [date] in your template displays the current date as defined by the clock on your web server. The format of the date is normally MM/DD/YYYY, but you can change the default format by changing the DateFormat preference in the WebDNA settings. You can override the default date format preference on a case-by-case basis by specifying a format inside the tag, as shown below. See [Time] for similar time formats.
[date] --> 08/14/2010Format: Description
%a....: Abbreviated weekday name "Wed"
%A....: Full weekday name "Wednesday"
%b....: Abbreviated month name "Feb"
%B....: Full month name "February"
%c....: Date and time "Wed Sep 19 18:24:21 2010"
%d....: Day of month 01-31
%H....: Hour 00-23
%I....: Hour 01-12
%j....: Day of year 001-365
%m....: Month 01-12
%M....: Minute 00-59
%p....: AM or PM
%S....: Seconds 00-59
%U....: Week # of year, Sunday first day of week
%w....: Weekday 0 (Sunday) - 6 (Saturday)
%W....: Week # of year, Monday first day of week
%x....: Date as Sep 11 2008
%X....: Time as 14:01:12
%y....: Year without century 00-99
%Y....: Year with century 1900-2199
%z....: offset of server
%Z....: Time zone of server
%%....: %
the [date] tag is sometimes confused with the [orderfile]'s [date] tag, which is not the same thing. The [date] tag inside the context of an [orderfile] represents the date the order was created, and does not have the ability to be formatted in special ways. If you want to display today's date inside of an [orderfile], then you must first assign a text variable outside the OrderFile context, and use that text variable from then on:
[text]todaysdate=[date][/Text]
[orderfile cart=[cart]]
Order Date: [date]
Today: [todaysdate]
[/orderfile]
[TIME %A, %I:%M %p] --> Friday, 10:30 AM
[date %A, %I:%M %p] --> Friday, 10:30 AM
[date format=%I:%M %p] is the same thing as [date %I:%M %p]
If you need to remove the leading "0" before the day or the month, this will do the trick:
[grep search= 0&replace= ]
[format Days_To_Date %A, %B %d, %Y][math]{[date]}[/math][/format]
[/grep]
It will show
"Friday, January 1, 2010"
instead of
"Friday, January 01, 2010"
ambiguous dates/times
If your dates contain a decimal point "." in them, then the [math] context will interpret them as Times instead of Dates. You can force it to interpret some text as a Date by inserting a "D" in front of the text, as in [math]{D10.01.2010}[/math], so that 10.01.2010 is interpreted as a date instead of a time. You can force Time interpretation by using "T" in place of the "D".
DOWNLOAD WEBDNA NOW!
Amazon Web Services (AWS) README for Machine Image ID...
WebDNA LibrariesA list of available libraries for WebDNA...
WebDNA referenceA list of all WebDNA instructions...
WebDNA ModulesA list of the currently available modules...
Tips and TricksA list of user-submitted tips ...
[biotype]BioType is a behavioral biometrics WebDNA function based on ADGS research and development (from version 8...
Creates a new thread to execute WebDNA simultaneously with the current template...
[convertwords]Changes specified words in a string of text to different words...
triggersTriggers provide a mechanism for doing something on a regular timed basis...
[SQLresult]...
[grep]Replaces text based on a regular expression...
[filecompare]Compares the size...