Date and Time Format Strings - Quick Reference Guide

Automation Master
Automation Master
57 35 112K

I've been referencing the MSDN articles a lot recently on Date and Time format strings and sometimes I get confused by the many options and sometimes these formats do not carry over or function. So I wanted to build a quick reference sheet that I can refer to in my workflows and forms.

First, how to use the inline and runtime functions.

fn-FormatDate in Workflows

Represents a date time value in text of a specific format.


fn-FormatDate({WorkflowVariable:MyDate}, d)

Other Notes

  • For workflow inline functions, using single quotes takes the value as a literal. So for the formateDate function fn-FormatDate({WorkflowVariable:MyDate}, 'D') provides the value of D.
  • Using double quotes or no quotes produces the same result. For example:

fn-FormatDate({WorkflowVariable:MyDate}, "dd/MM/yyyy") and fn-FormatDate({WorkflowVariable:MyDate}, dd/MM/yyyy) both produce 11/08/2015

fn-FormatDate({WorkflowVariable:MyDate}, "D") and fn-FormatDate({WorkflowVariable:MyDate}, D) both produce Tuesday, August 11, 2015

  • If you attempt to calculate for a time format, but the value provided is date ONLY, then the function will result in an error.

Time Calculations

For Time intervals, I found that using a single h, to provide the non-leading zero hour does not work and results in an error. But if you use the special format character % you can get the result of a non-leading zero hour digit. For exmaple: fn-FormatDate({WorkflowVariable:MyDate}, %h) returns 8, while fn-FormatDate({WorkflowVariable:MyDate}, hh) returns 08.

formatDate on Forms

Returns the date in the specified format.


formatDate(date, format) or formateDate({namedControl}, "D")

Other Notes

  • In the format string, using single or double quotes is required. Using no quotes results in an error.

Table of Date and Time Format Strings

The specified format can incorporate structures such as "dd/MM/yyyy" or "dddd", "dd MMM". Alternatively, single character format specifiers can be used. The components of these structures include:

Element Description Example (in US date format)

Format Specifier





Day of month (double digit) 3/1/2017 

fn-FormatDate({CurrentDate}, "dd")



Day of week (Abbreviated) 3/1/2017 

fn-FormatDate({CurrentDate}, "ddd")

Wed or W (see notes)


Day of week (Full) 3/1/2017

fn-FormatDate({CurrentDate}, "dddd")



Month (Numeric) 3/1/2017

fn-FormatDate({CurrentDate}, "MM")



Month (Short) 3/1/2017

fn-FormatDate({CurrentDate}, "MMM")



Month (Full) 3/1/2017

fn-FormatDate({CurrentDate}, "MMMM")



Year 3/1/2017 1:45:30 PM

fn-FormatDate({CurrentDate}, "yyyy")



Hours (12 Hour) 3/1/2017 1:45:30 PM

fn-FormatDate({CurrentDate}, "%h")



Hours (12 Hour) 3/1/2017 1:45:30 PM

fn-FormatDate({CurrentDate}, "hh")

01 in WF, but 1 in Forms


Hours (24 hour) 3/1/2017 1:45:30 PM

fn-FormatDate({CurrentDate}, "HH")



Minutes 3/1/2017 1:45:30 PM

fn-FormatDate({CurrentDate}, "mm")



AM or PM 3/1/2017 1:45:30 PM

fn-FormatDate({CurrentDate}, "tt")



Short date pattern 3/1/2017

fn-FormatDate({CurrentDate}, "d")



Long date pattern 3/1/2017

fn-FormatDate({CurrentDate}, "D")

Wednesday, March 1, 2017

"M", "m"

Month/day pattern 3/1/2017

fn-FormatDate({CurrentDate}, "M")

March 1


Sortable date/time pattern 6/15/2009 1:45:30 PM

fn-FormatDate({CurrentDate}, "s")



Short time 3/1/2017 1:45:30 PM

fn-FormatDate({CurrentDate}, "t")



Long time 3/1/2017 1:45:30 PM

fn-FormatDate({CurrentDate}, "T")


"Y", "y"

Year month 3/1/2017 1:45:30 PM

fn-FormatDate({CurrentDate}, "Y")

March 2017


Short Date pattern 3/1/2017

fn-FormatDate({CurrentDate}, "M/d/y")



Short Date pattern 3/1/2017

fn-FormatDate({CurrentDate}, "d/M/y")



Short Date with leading zero Day and Month

fn-FormatDate({CurrentDate}, "MM/dd/yyyy")



Short Date with leading zero Day

fn-FormatDate({CurrentDate}, "M/dd/yyyy")



Short Date with leading zero Month

fn-FormatDate({CurrentDate}, "MM/d/yyyy")



  • dd - will provide a two digit days, so the first of the month will be 01
  • MM - will provide a two digit month, so March will be seen as 03. Using a single M will be just 3, a single digit. Notice that capital M is month and lowercase m is minutes.
  • d - can be used in two different ways. "d" by itself provides a short date pattern 3/1/2017, while using d in a date pattern like "M/d/y" will provide 3/1/17. Notice it is a single digit day when appropriate.
  • y - can be used in two different ways. "y" by itself provides a Year Month pattern of March 2017. But using "y" in a date pattern like "M/d/y" will provide 3/1/17. Notice the year is only the last two digits.
  • Using "ddd" provides an abbreviation of the day name. But it was found to react differently based on platform and local
    • On Prem: return W in English, other locals produce a 2 or 3 character response as appropriate. As Marian Hatala‌ noted, the value of day name abbrv is taken from Sys.CultureInfo.CurrentCulture.dateTimeFormat.ShortestDayNames
    • O365: returns Wed
Nintex Newbie

This is an excellent resource.  Thank you Andrew!

Design Dabbler


Thanks this is GREAT! @Andrew Glasser

Automation Master
Automation Master

excellent - Josh Shutts​ this might come in handy for you

Forms Fledgling

Very cool! Thanks for thinking of me!

Nintex Newbie

Great resource. Thank you Andrew.

Nintex Newbie

Hi ‌,

Just for the record: When I use the 'ddd' option, I get a double letter returned (ma, di, ...). My locale is Dutch.



Automation Master
Automation Master

I just updated the format table with usage examples as well as some additional usages. Please see the new NOTES section at the bottom for additional tips. 

Automation Master
Automation Master


we were testing our most recent upgrade of forms and looking at these. Tried "ddd" and it didn't work. Went to our previous version and it didn't work. Support have said it has never worked. Thought I'd let you know

Automation Master
Automation Master

FormatDate({CurrentDate}, "ddd") works in Nintex Forms in O365 for sure! What version didn't work for you? There could be a limitation somewhere i'm sure. 

Automation Master
Automation Master

for me it works as well - tested on NF2013 and

with just slight difference to the table above that day abbrv for english locale is returned as single character (first letter).

for other locales it returns 2 or 3 characters long abbrv.

the value of day name abbrv it taken from Sys.CultureInfo.CurrentCulture.dateTimeFormat.ShortestDayNames

Automation Master
Automation Master

On prem the latest version (can't remember numbers right now). Yes does what Marian says and just gives me the first letter. I can get first letter or full day, just not abbreviation. Anyway, support are investigating I'll keep you posted  

Automation Master
Automation Master

Ok, that makes sense then. My testing on prem when I wrote the first article had just the first letter also. That msut have been the reason. When I tested them all again this time, I did it in O365 and go the three letters. 

I agree with you, the on prem other locals provide 2 or 3, but English is single character. 

Great work team in finding out the details! Not sure what the expected behavior is as they were not documented before. So each version and local may be working as planned, just not consistent. 

Automation Master
Automation Master

Thanks guys, I updated the table and notes to include your findings as to call it out quickly to others. Your contributions are much appreciated!

Nintex Newbie

Dates can be a pain sometimes.

Automation Master
Automation Master

In case anyone runs into the issue and ends up here like I did: if you have a repeating section in O365 and are trying to use Get Item From Collection to retrieve a date and put it in a date variable, you're going to need to use a text variable and then convert it. You can, surprisingly, drop that text variable right into a date/time column. SPO didn't yell at me about this, and I was shocked.

(I ended up here trying to figure out how to convert the txt string to a date variable.)

Canvas Initiate

Thank you Andrew. This is a very comprehensive list applicable to most business cases I would guess, but how does one go about creating a date format like "28-NOV-2017"?

The global enterprise client I am working with currently would like to use this configuration.

Automation Master
Automation Master


fn-FormatDate({CurrentDate}, "d-MMM-yyyy")

use 'dd' if you want the day to read 03 instead of 3 (using 'd') when it's the 3rd of the month.

Nintex Newbie

Could you help me concatenate this into a Single line of text field? I'm trying to use the Build String action with the date format to generate control numbers on a list, but the date format isn't returning properly. What am I doing wrong here?

Input (Build String action):


Output field (Single line of text format):

8D-fn-FormatDate(1/1/0001 12:00:00 AM,"yyyy")-058

Automation Master
Automation Master

You probably want to do this in two steps because of the text surrounding the inline function may confuse the rules engine. Do fn-FormatDate({Variable:startyear},"yyyy") in a variable first, then add it to the field update 


Workflow Hero


is it possible to combine / concatenate the CurrentDate and CurrentTime together?

I have been trying the flowing variable in an Update Item :

fn-FormatDate(Current Date,"ddMMyy")fn-FormatDate(Current Time,"HH:mm:ss")

My intention is to be like 150118132310 (without any semicolons or dots.)

Current Date 150118

Current Time 132310 (HH MM SS)

Any advise?

Connector Crackerjack

Should work. I used following in Build String action and it's working:


Nintex Newbie

How can one change the  CultureInfo.CurrentCulture format? I want to use "he-HE" format of date

Automation Master
Automation Master

it's browser's internal variable which is automatically being configured by your user profile and/or site settings

Canvas Initiate

I am trying this but SECONDS is always showing "00" ... 


Using RESPONSIVE form mode.

Forms Fledgling

I am getting the same issue on a form with a calculated value and in a workflow.   It's amazing the amount of effort you have to do for something as simple as the seconds in a data/time value.

Calculated Value - Formula


Workflow Action - Calculated Date

Results: "00" seconds where it should be "34"

Workflow Hero

Can you screenshot the Calculated Date function and the variable types you have used.
Make sure to use date/time variable to Store Date In: 

In my example it would be:


Cloud Wanderer

Really helpful stuff! Thank you!

Nintex Newbie

Hello, I am getting as it is string in string builder action, trying to get date in dd-MMM-yyyy format. Please see screenshot attached. 

Forms Fledgling

Today seems to be one of those days: It is/was January 2nd. But I got  a return from our fn-FormatDate("MMM dd") function of "Feb 01" . Source is a regular date field. Typical case of mixing up m/d/y and d/m/y formatting, it seems.

A date representation of January 2nd

Regional settings are on UTC time zone and English (United States) for this entire site collection. Had no problems since the 2nd half of December 2018 when this workflow started. As soon as numbers get above 12 there is no doubt of course.

Any easy suggestions to prevent this from happening?

Automation Master
Automation Master

Hm, I'm trying to remember when I've seen that before. I think I recall checking the server's region and time zone set up. Is this on-premise?

Forms Fledgling

I checked and you are correct it seems. Originally the on-premise installation of SP2016 was done in the UK and my site collection with this issue was on US region. Switching the entire site collection back to UK region solved the problem. Apparently this supersedes the site collection level.

Automation Master
Automation Master

Good to see that helped. It can be the reason, but not always. If the workflow is running under the owstimer service or workflow service on the server then it matters what the server is setup as. If the workflow runs in the AppPool it should take your context and not the servers. So if this was happening or not at some point and there was an "unexplained" changed, usually its that the workflows were paused naturally in the logic or there were too many running in the AppPool at one time and it was queued. Queued workflows run in the server's context when they start up. (And queued workflows can run within 5 minutes, not to mislead that its a long pause)

Forms Fledgling

This is an awesome resource and I will come back here often. Would you mind adding the "g" and "G" options as I think it would be really useful. It picks up the local date settings too so here in Australia the date shows correctly as 27/02/2019.





General date/time pattern (short time)

fn-FormatDate({CurrentDate}, "g")

02/27/2019 3:27 PM


General date/time pattern (long time)

fn-FormatDate({CurrentDate}, "G")

02/27/2019 3:27:25 PM



Canvas Initiate

Did they add "g" or "G" in formating? I need similar datetime format in my calculated values.

"Short" format mentioned here doesnot work on my classic Nintex 2013 form.

Any help on how to get the desired result is appreciated.




Canvas Initiate

This is awesome! 🙂

As soon, as I checked how to Kudo, I'll do it. to this platform.