Date, Time and Period Formats in Scripts

Some script statements and functions let you specify formats for date, time and periods.

This page includes the following:

Tip: You can use script functions to convert date, time and period formats. For more information, see Script Date and Time Functions.

Note: Some predefined variables have specific requirements for supported date and time formats. For more information, see Date and Time Formats Variable.

Date Formats

Use the following abbreviations in date formats:

  • Y or J for the year
  • M for the month
  • D or T for the day

The following date formats are permitted:

  • YYMMDD or JJMMTT
  • YY.MM.DD or JJ.MM.TT
  • YY-MM-DD or JJ-MM-TT
  • YYYYMMDD or JJJJMMTT
  • YYYY.MM.DD or JJJJ.MM.TT
  • YYYY-MM-DD or JJJJ-MM-TT
  • DDMMYY or TTMMJJ
  • DD.MM.YY or TT.MM.JJ
  • DD-MM-YY or TT-MM-JJ
  • DDMMYYYY or TTMMJJJJ
  • DD.MM.YYYY or TT.MM.JJJJ
  • DD-MM-YYYY or TT-MM-JJJJ
  • MMDDYY
  • MMDDYYYY
  • MM/DD/YY
  • MM/DD/YYYY

You can specify the following special terms for date formats:

  • YY or JJ
  • YYYY or JJJJ
  • MM
  • DD or TT
  • WW
    Day of the week based on the two-character German abbreviations for weekdays:
    • MO for Monday
    • DI for Tuesday
    • MI for Wednesday
    • DO for Thursday
    • FR for Friday
    • SA for Saturday
    • SO for Sunday
  • LLL
    Day number of the year

Note: You cannot use special terms for date formats in script functions that calculate based on dates, except for output formats of a calculated date.

Time Formats

Use the following abbreviations for time formats:

  • H for hours
  • M for minutes
  • S for seconds

The following time formats are permitted:

  • HHMMSS
  • HH:MM:SS
  • HHMM
  • HH:MM
  • MMSS
  • MM:SS

You can specify the following special terms for time formats:

  • HH
  • MM
  • SS

Period Formats

Use the following abbreviations for period formats:

  • J or Y for the year
  • Q for the quarter
  • M for the month
  • W for the calendar week
  • The following abbreviations are used for period formats:  "J" or "Y" for the year, "Q" for the quarter, "M" for the month and "W" for the calendar week.

The following period formats are permitted:

  • YY or JJ
  • YYYY or JJJJ
  • Q
  • MM
  • WW
    Note: Monday is considered the first day of the week. See date formats above.
  • WS
    Note: Use this format in script functions that determine the first or last day of a period only. Sunday is considered the first day of the week.

You can use period formats in the following script elements:

See also: