Format Date/Time

 

Updated: May 13, 2016

Applies To: System Center 2012 SP1 - Orchestrator, System Center 2012 - Orchestrator, System Center 2012 R2 Orchestrator

The Format Date/Time activity enables you to transform existing date and time formats into custom formats that you create.

Before you configure the Format Date/Time activity, you need to determine the following:

  • The existing date and time format you want to transform.

  • The new date and time format you want it to become.

Use the following information to configure the Format Date/Time activity.

Details Tab

SettingsConfiguration Instructions
Date/TimeType the time that you want to convert.
FormatType the format of the time that you want to convert. See the Date/Time Format Codes table for format codes and examples.
FormatType the format that you want to convert the input time to.
Output AdjustmentsType a number in any of the following fields to adjust the output time from the input time. For example, if the input time is coming from a server that is three hours ahead of your local time, type -3 in the Hours field to set the output time (your local time) to three hours behind the input time. If the input time is three hours behind your local time, type 3 to set the output time to three hours ahead of the input time.

You can adjust the output time using the following time units:

Days

Months

Years

Hours

Minutes

Seconds

To specify a date/time format, you must enter the codes that represent each part of the date and time.

Date/Time Format Codes

CodeDescription
yThe last digit of the year. For example, 2005 would be represented as 5.
yyThe last two digits of the year number. For example, in this format 2005 would be represented as 05.
yyyyThe year number in four digits. For example, in this format 2005 would be represented as 2005.
MMonth as a number from 1 to 12. If the month number is a single-digit number, it is displayed without a leading zero.
MMMonth in two digits. If the month number is a single-digit number, it is displayed with a leading zero.
MMMThe name of the month in three letters. For example, August would be represented as Aug.
MMMMThe name of the month spelled in full. This format is supported only for output time. Note: This format is only supported for the output format.
dDay as a number from 1 to 31. If the day number is a single-digit number, it is displayed without a leading zero.
ddDay in two digits. If the day number is a single-digit number, it is displayed with a leading zero.
dddThe abbreviated name of the day of the week in three letters. For example, Saturday is abbreviated as “Sat”.
ddddThe full name of the day of the week. For example, Saturday is displayed in full. Note: This format is only supported for the output format.
hHour as a number from 1 to 12 when using the 12-hour clock. If the hour number is a single-digit number, it is displayed without a leading zero.
hhHour in two digits using the 12-hour clock. If the hour number is a single-digit number, it is displayed with a leading zero.
HHour as a number from 0 to 23 when using the 24-hour clock. For example, in this format 1 pm would be represented as 13. If the hour number is a single-digit number, it is displayed without a leading zero.
HHHour in two digits using the 24-hour clock. For example, in this format 1 pm would be represented as 13. If the hour number is a single-digit number, it is displayed with a leading zero
mMinutes as a number from 0 to 59. If the minute number is a single-digit number, it is displayed without a leading zero.
mmMinutes in two digits. If the minute number is a single-digit number, it is displayed with a leading zero.
sSeconds as a number from 0 to 59. If the second number is a single-digit number, it is displayed without a leading zero.
ssSeconds in two digits. If the second number is a single-digit number, it is displayed with a leading zero.
ttA.M. or P.M. as two letters: A.M. or P.M. as defined on your system.

Here are some examples of dates and times and their corresponding format:

FormatDate
MM/dd/yyyy hh:mm:ss tt08/05/2006 03:05:15 PM
M/d/yy h:m:s tt8/5/06 3:5:15 PM
ddd MMM dd yyyySat Aug 05 2006
dddd, MMMM dd yyyySaturday, August 05 2006

Published Data

The following table lists the published data items.

ItemDescription
Format ResultThe result of the format in the specified form.
Format Result without adjustmentsThe formatted result, but without any adjustments made to it.
Input TimeThe input time.
Input FormatThe format of the date and time that was entered as the input time.
Output FormatThe format of the date and time that was entered as the output time.
Show: