Push2Run DateTime format codes

 
   

With the Push2Run 'Keys to send' option you can have the program automatically key the current date and/or time using the DATETIME command.

The format of this command is        {DATETIME format code(s) }

An example is:                                {DATETIME yyyy-MM-dd h:mm:ss tt}
which would result in (for example):   2010-06-15 10:45:30 PM

Here are the format codes you can use:

Format code

Description

Examples

"d"

The day of the month, from 1 through 31.

More information: The "d" format code.

6/1/2010 1:45:30 PM -> 1

6/15/2010 1:45:30 PM -> 15

"dd"

The day of the month, from 01 through 31.

More information: The "dd" format code.

6/1/2010 1:45:30 PM -> 01

6/15/2010 1:45:30 PM -> 15

"ddd"

The abbreviated name of the day of the week.

More information: The "ddd" format code.

6/15/2010 1:45:30 PM -> Mon (en-US)

6/15/2010 1:45:30 PM -> Пн (ru-RU)

6/15/2010 1:45:30 PM -> lun. (fr-FR)

"dddd"

The full name of the day of the week.

More information: The "dddd" format code.

6/15/2010 1:45:30 PM -> Monday (en-US)

6/15/2010 1:45:30 PM -> понедельник (ru-RU)

6/15/2010 1:45:30 PM -> lundi (fr-FR)

"f"

The tenths of a second in a date and time value.

More information: The "f" format code.

6/15/2010 13:45:30.617 -> 6

6/15/2010 13:45:30.050 -> 0

"ff"

The hundredths of a second in a date and time value.

More information: The "ff" format code.

6/15/2010 13:45:30.617 -> 61

6/15/2010 13:45:30.005 -> 00

"fff"

The milliseconds in a date and time value.

More information: The "fff" format code.

6/15/2010 13:45:30.617 -> 617

6/15/2010 13:45:30.0005 -> 000

"ffff"

The ten thousandths of a second in a date and time value.

More information: The "ffff" format code.

6/15/2010 13:45:30.6175 -> 6175

6/15/2010 13:45:30.00005 -> 0000

"fffff"

The hundred thousandths of a second in a date and time value.

More information: The "fffff" format code.

6/15/2010 13:45:30.61754 -> 61754

6/15/2010 13:45:30.000005 -> 00000

"ffffff"

The millionths of a second in a date and time value.

More information: The "ffffff" format code.

6/15/2010 13:45:30.617542 -> 617542

6/15/2010 13:45:30.0000005 -> 000000

"fffffff"

The ten millionths of a second in a date and time value.

More information: The "fffffff" format code.

6/15/2010 13:45:30.6175425 -> 6175425

6/15/2010 13:45:30.0001150 -> 0001150

"F"

If non-zero, the tenths of a second in a date and time value.

More information: The "F" format code.

6/15/2010 13:45:30.617 -> 6

6/15/2010 13:45:30.050 -> (no output)

"FF"

If non-zero, the hundredths of a second in a date and time value.

More information: The "FF" format code.

6/15/2010 13:45:30.617 -> 61

6/15/2010 13:45:30.005 -> (no output)

"FFF"

If non-zero, the milliseconds in a date and time value.

More information: The "FFF" format code.

6/15/2010 13:45:30.617 -> 617

6/15/2010 13:45:30.0005 -> (no output)

"FFFF"

If non-zero, the ten thousandths of a second in a date and time value.

More information: The "FFFF" format code.

6/1/2010 13:45:30.5275 -> 5275

6/15/2010 13:45:30.00005 -> (no output)

"FFFFF"

If non-zero, the hundred thousandths of a second in a date and time value.

More information: The "FFFFF" format code.

6/15/2010 13:45:30.61754 -> 61754

6/15/2010 13:45:30.000005 -> (no output)

"FFFFFF"

If non-zero, the millionths of a second in a date and time value.

More information: The "FFFFFF" format code.

6/15/2010 13:45:30.617542 -> 617542

6/15/2010 13:45:30.0000005 -> (no output)

"FFFFFFF"

If non-zero, the ten millionths of a second in a date and time value.

More information: The "FFFFFFF" format code.

6/15/2010 13:45:30.6175425 -> 6175425

6/15/2010 13:45:30.0001150 -> 000115

"g", "gg"

The period or era.

More information: The "g" or "gg" format code.

6/15/2010 1:45:30 PM -> A.D.

"h"

The hour, using a 12-hour clock from 1 to 12.

More information: The "h" format code.

6/15/2010 1:45:30 AM -> 1

6/15/2010 1:45:30 PM -> 1

"hh"

The hour, using a 12-hour clock from 01 to 12.

More information: The "hh" format code.

6/15/2010 1:45:30 AM -> 01

6/15/2010 1:45:30 PM -> 01

"H"

The hour, using a 24-hour clock from 0 to 23.

More information: The "H" format code.

6/15/2010 1:45:30 AM -> 1

6/15/2010 1:45:30 PM -> 13

"HH"

The hour, using a 24-hour clock from 00 to 23.

More information: The "HH" format code.

6/15/2010 1:45:30 AM -> 01

6/15/2010 1:45:30 PM -> 13

"K"

Time zone information.

More information: The "K" format code.

With DateTime values:

6/15/2010 1:45:30 PM, Kind Unspecified ->

6/15/2010 1:45:30 PM, Kind Utc -> Z

6/15/2010 1:45:30 PM, Kind Local -> -07:00 (depends on local computer settings)

With DateTimeOffset values:

6/15/2010 1:45:30 AM -07:00 --> -07:00

6/15/2010 8:45:30 AM +00:00 --> +00:00

"m"

The minute, from 0 through 59.

More information: The "m" format code.

6/15/2010 1:09:30 AM -> 9

6/15/2010 1:09:30 PM -> 9

"mm"

The minute, from 00 through 59.

More information: The "mm" format code.

6/15/2010 1:09:30 AM -> 09

6/15/2010 1:09:30 PM -> 09

"M"

The month, from 1 through 12.

More information: The "M" format code.

6/15/2010 1:45:30 PM -> 6

"MM"

The month, from 01 through 12.

More information: The "MM" format code.

6/15/2010 1:45:30 PM -> 06

"MMM"

The abbreviated name of the month.

More information: The "MMM" format code.

6/15/2010 1:45:30 PM -> Jun (en-US)

6/15/2010 1:45:30 PM -> juin (fr-FR)

6/15/2010 1:45:30 PM -> Jun (zu-ZA)

"MMMM"

The full name of the month.

More information: The "MMMM" format code.

6/15/2010 1:45:30 PM -> June (en-US)

6/15/2010 1:45:30 PM -> juni (da-DK)

6/15/2010 1:45:30 PM -> uJuni (zu-ZA)

"s"

The second, from 0 through 59.

More information: The "s" format code.

6/15/2010 1:45:09 PM -> 9

"ss"

The second, from 00 through 59.

More information: The "ss" format code.

6/15/2010 1:45:09 PM -> 09

"t"

The first character of the AM/PM designator.

More information: The "t" format code.

6/15/2010 1:45:30 PM -> P (en-US)

6/15/2010 1:45:30 PM -> 午 (ja-JP)

6/15/2010 1:45:30 PM -> (fr-FR)

"tt"

The AM/PM designator.

More information: The "tt" format code.

6/15/2010 1:45:30 PM -> PM (en-US)

6/15/2010 1:45:30 PM -> 午後 (ja-JP)

6/15/2010 1:45:30 PM -> (fr-FR)

"y"

The year, from 0 to 99.

More information: The "y" format code.

1/1/0001 12:00:00 AM -> 1

1/1/0900 12:00:00 AM -> 0

1/1/1900 12:00:00 AM -> 0

6/15/2010 1:45:30 PM -> 9

"yy"

The year, from 00 to 99.

More information: The "yy" format code.

1/1/0001 12:00:00 AM -> 01

1/1/0900 12:00:00 AM -> 00

1/1/1900 12:00:00 AM -> 00

6/15/2010 1:45:30 PM -> 09

"yyy"

The year, with a minimum of three digits.

More information: The "yyy" format code.

1/1/0001 12:00:00 AM -> 001

1/1/0900 12:00:00 AM -> 900

1/1/1900 12:00:00 AM -> 1900

6/15/2010 1:45:30 PM -> 2010

"yyyy"

The year as a four-digit number.

More information: The "yyyy" format code.

1/1/0001 12:00:00 AM -> 0001

1/1/0900 12:00:00 AM -> 0900

1/1/1900 12:00:00 AM -> 1900

6/15/2010 1:45:30 PM -> 2010

"yyyyy"

The year as a five-digit number.

More information: The "yyyyy" format code.

1/1/0001 12:00:00 AM -> 00001

6/15/2010 1:45:30 PM -> 02010

"z"

Hours offset from UTC, with no leading zeros.

More information: The "z" format code.

6/15/2010 1:45:30 PM -07:00 -> -7

"zz"

Hours offset from UTC, with a leading zero for a single-digit value.

More information: The "zz" format code.

6/15/2010 1:45:30 PM -07:00 -> -07

"zzz"

Hours and minutes offset from UTC.

More information: The "zzz" format code.

6/15/2010 1:45:30 PM -07:00 -> -07:00

":"

The time separator.

More information: The ":" format code.

6/15/2010 1:45:30 PM -> : (en-US)

6/15/2010 1:45:30 PM -> . (it-IT)

6/15/2010 1:45:30 PM -> : (ja-JP)

"/", "-" and "."

The date separator.

More Information: The "/", "-" and  "." format codes.

6/15/2010 1:45:30 PM -> / (en-US)

6/15/2010 1:45:30 PM -> - (ar-DZ)

6/15/2010 1:45:30 PM -> . (tr-TR)

"string"

'string'

A group of letters, numbers and/or special characters surrounded by quotes.

6/15/2010 1:45:30 PM ("arr:" h:m t) -> arr: 1:45 P

6/15/2010 1:45:30 PM ('arr:' h:m t) -> arr: 1:45 P

\

The escape character.

6/15/2010 1:45:30 PM (h \h) -> 1 h

Any other character

The character is copied to the result string unchanged.

6/15/2010 1:45:30 AM (arr hh:mm t) -> arr 01:45 A

 

The "d" format codes

The "d" format code represents the day of the month as a number from 1 through 31. A single-digit day is formatted without a leading zero.

If the "d" Format code is used without other format codes, it is interpreted as the "d" standard date and time Format code.

Back to table

The "dd" format codes

The "dd" format codes represent the day of the month as a number from 01 through 31. A single-digit day is formatted with a leading zero.

The following example includes the "dd" format code in a format codes.

Back to table

The "ddd" format codes

The "ddd" format codes represent the abbreviated name of the day of the week.

Back to table

The "dddd" format codes

The "dddd" format codes (plus any number of additional "d" Codes) represents the full name of the day of the week.

Back to table

The "f" format codes

The "f" format code represents the most significant digit of the seconds fraction; that is, it represents the tenths of a second in a date and time value.

When you use "f" format code the number of "f" format codes indicates the number of most significant digits of the seconds fraction that must be present to successfully parse the string.

Back to table

The "ff" format codes

The "ff" format code represents the two most significant digits of the seconds fraction; that is, it represents the hundredths of a second in a date and time value.

Back to table

The "fff" format codes

The "fff" format codes represent the three most significant digits of the seconds fraction; that is, it represents the milliseconds in a date and time value.

Back to table

The "ffff" format codes

The "ffff" format codes represent the four most significant digits of the seconds fraction; that is, it represents the ten thousandths of a second in a date and time value.

Although it is possible to display the ten thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On the Windows NT version 3.5 (and later) and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

Back to table

The "fffff" format codes

The "fffff" format codes represent the five most significant digits of the seconds fraction; that is, it represents the hundred thousandths of a second in a date and time value.

Although it is possible to display the hundred thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On the Windows NT 3.5 (and later) and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

Back to table

The "ffffff" format codes

The "ffffff" format codes represent the six most significant digits of the seconds fraction; that is, it represents the millionths of a second in a date and time value.

Although it is possible to display the millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On the Windows NT 3.5 (and later) and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

Back to table

The "fffffff" format codes

The "fffffff" format codes represent the seven most significant digits of the seconds fraction; that is, it represents the ten millionths of a second in a date and time value.

Although it is possible to display the ten millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On the Windows NT 3.5 (and later) and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

Back to table

The "F" format codes

The "F" format code represents the most significant digit of the seconds fraction; that is, it represents the tenths of a second in a date and time value. Nothing is displayed if the digit is zero.

If the "F" format code is used without other format codes, it is interpreted as the "F" standard date and time Format code.

Back to table

The "FF" format codes

The "FF" format code represents the two most significant digits of the seconds fraction; that is, it represents the hundredths of a second in a date and time value. However, trailing zeros or two zero digits are not displayed.

Back to table

The "FFF" format codes

The "FFF" format codes represent the three most significant digits of the seconds fraction; that is, it represents the milliseconds in a date and time value. However, trailing zeros or three zero digits are not displayed.

Back to table

The "FFFF" format codes

The "FFFF" format codes represent the four most significant digits of the seconds fraction; that is, it represents the ten thousandths of a second in a date and time value. However, trailing zeros or four zero digits are not displayed.

Although it is possible to display the ten thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On the Windows NT 3.5 (and later) and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

Back to table

The "FFFFF" format codes

The "FFFFF" format codes represent the five most significant digits of the seconds fraction; that is, it represents the hundred thousandths of a second in a date and time value. However, trailing zeros or five zero digits are not displayed.

Although it is possible to display the hundred thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On the Windows NT 3.5 (and later) and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

Back to table

The "FFFFFF" format codes

The "FFFFFF" format codes represent the six most significant digits of the seconds fraction; that is, it represents the millionths of a second in a date and time value. However, trailing zeros or six zero digits are not displayed.

Although it is possible to display the millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On the Windows NT 3.5 (and later) and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

Back to table

The "FFFFFF" format codes

The "FFFFFFF" format codes represent the seven most significant digits of the seconds fraction; that is, it represents the ten millionths of a second in a date and time value. However, trailing zeros or seven zero digits are not displayed.

Although it is possible to display the ten millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On the Windows NT 3.5 (and later) and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

Back to table

The "g" or "gg" format codes

The "g" or "gg" format codes (plus any number of additional "g" Codes) represents the period or era, such as A.D. The formatting operation ignores this code if the date to be formatted does not have an associated period or era string.

If the "g" Format code is used without other format codes, it is interpreted as the "g" standard date and time Format code.

Back to table

The "h" format codes

The "h" format code represents the hour as a number from 1 through 12; that is, the hour is represented by a 12-hour clock that counts the whole hours since midnight or noon. A particular hour after midnight is indistinguishable from the same hour after noon. The hour is not rounded, and a single-digit hour is formatted without a leading zero. For example, given a time of 5:43 in the morning or afternoon, this format codes displays "5".

Back to table

The "hh" format codes

The "hh" format code (plus any number of additional "h" Codes) represents the hour as a number from 01 through 12; that is, the hour is represented by a 12-hour clock that counts the whole hours since midnight or noon. A particular hour after midnight is indistinguishable from the same hour after noon. The hour is not rounded, and a single-digit hour is formatted with a leading zero. For example, given a time of 5:43 in the morning or afternoon, this Format code displays "05".

Back to table

The "H" format codes

The "H" format code represents the hour as a number from 0 through 23; that is, the hour is represented by a zero-based 24-hour clock that counts the hours since midnight. A single-digit hour is formatted without a leading zero.

Back to table

The "HH" format codes

The "HH" format code (plus any number of additional "H" Codes) represents the hour as a number from 00 through 23; that is, the hour is represented by a zero-based 24-hour clock that counts the hours since midnight. A single-digit hour is formatted with a leading zero.

Back to table

The "K" format codes

The "K" format code represents the time zone information of a date and time value.

Back to table

The "m" format codes

The "m" format code represents the minute as a number from 0 through 59. The minute represents whole minutes that have passed since the last hour. A single-digit minute is formatted without a leading zero.

Back to table

The "mm" format codes

The "mm" format code (plus any number of additional "m" Codes) represents the minute as a number from 00 through 59. The minute represents whole minutes that have passed since the last hour. A single-digit minute is formatted with a leading zero.

Back to table

The "M" format codes

The "M" format code represents the month as a number from 1 through 12 (or from 1 through 13 for calendars that have 13 months). A single-digit month is formatted without a leading zero.

Back to table

The "MM" format codes

The "MM" format code represents the month as a number from 01 through 12 (or from 1 through 13 for calendars that have 13 months). A single-digit month is formatted with a leading zero.

Back to table

The "MMM" format codes

The "MMM" format codes represent the abbreviated name of the month.

Back to table

The "MMMM" format codes

The "MMMM" format codes represent the full name of the month.

Back to table

The "s" format codes

The "s" format code represents the seconds as a number from 0 through 59. The result represents whole seconds that have passed since the last minute. A single-digit second is formatted without a leading zero.

Back to table

The "ss" format codes

The "ss" format code (plus any number of additional "s" Codes) represents the seconds as a number from 00 through 59. The result represents whole seconds that have passed since the last minute. A single-digit second is formatted with a leading zero.

Back to table

The "t" format codes

The "t" format code represents the first character of the AM/PM designator. The AM designator is used for all times from 0:00:00 (midnight) to 11:59:59.999. The PM designator is used for all times from 12:00:00 (noon) to 23:59:59.99.

Back to table

The "tt" format codes

The "tt" format code (plus any number of additional "t" Codes) represents the entire AM/PM designator. The AM designator is used for all times from 0:00:00 (midnight) to 11:59:59.999. The PM designator is used for all times from 12:00:00 (noon) to 23:59:59.99.

Back to table

The "y" format codes

The "y" format code represents the year as a one-digit or two-digit number. If the year has more than two digits, only the two low-order digits appear in the result. If the first digit of a two-digit year begins with a zero (for example, 2008), the number is formatted without a leading zero.

Back to table

The "yy" format codes

The "yy" format code represents the year as a two-digit number. If the year has more than two digits, only the two low-order digits appear in the result. If the two-digit year has fewer than two significant digits, the number is padded with leading zeros to produce two digits.

Back to table

The "yyy" format codes

The "yyy" format codes represent the year with a minimum of three digits. If the year has more than three significant digits, they are included in the result string. If the year has fewer than three digits, the number is padded with leading zeros to produce three digits.

For the Thai Buddhist calendar, which can have five-digit years, this Format code displays all significant digits.

Back to table

The "yyyy" format codes

The "yyyy" format codes represent the year with a minimum of four digits. If the year has more than four significant digits, they are included in the result string. If the year has fewer than four digits, the number is padded with leading zeros to produce four digits.

For the Thai Buddhist calendar, which can have five-digit years, this Format code displays a minimum of four digits.

Back to table

The "yyyyy" format codes

The "yyyyy" format codes (plus any number of additional "y" Codes) represents the year with a minimum of five digits. If the year has more than five significant digits, they are included in the result string. If the year has fewer than five digits, the number is padded with leading zeros to produce five digits.

If there are additional "y" Codes, the number is padded with as many leading zeros as necessary to produce the number of "y" Codes.

Back to table

The "z" format codes

The "z" format code represents the signed offset of the local operating system's time zone from Coordinated Universal Time (UTC), measured in hours.

The offset is always displayed with a leading sign. A plus sign (+) indicates hours ahead of UTC, and a minus sign (-) indicates hours behind UTC. A single-digit offset is formatted without a leading zero.

Back to table

The "zz" format codes

The "zz" format code represents the signed offset of the local operating system's time zone from UTC, measured in hours.

The offset is always displayed with a leading sign. A plus sign (+) indicates hours ahead of UTC, and a minus sign (-) indicates hours behind UTC. A single-digit offset is formatted with a leading zero.

Back to table

The "zzz" format codes

The "zzz" format code represents the signed offset of the local operating system's time zone from UTC, measured in hours and minutes.

The offset is always displayed with a leading sign. A plus sign (+) indicates hours ahead of UTC, and a minus sign (-) indicates hours behind UTC. A single-digit offset is formatted with a leading zero.

Back to table

The ":" format codes

The ":" format code represents the time separator, which is used to differentiate hours, minutes, and seconds.

Back to table

The "/", "-"  and "." format codes

The "/", "-" and "." format codes represent a date separator, which is used to differentiate years, months, and days.


 
   
 
 
You're welcome to download and use Push2Run for free on as many computers as you like!
 
 
 
 
 

Click here to download Push2Run


PayPal donations are very much appreciated
 
 
  info@push2run.com   Copyright © 2018 Rob Latour.
All Rights Reserved.
 
  Other great software by Rob Latour:
   A Ruler for Windows   A Form Filler   CallClerk   Concentration  FixMyLocation 
  MyArp   Reporting for Rackspace   S-Controller   SetVol   UDPRun