Guest User

Untitled

a guest
Jul 17th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.61 KB | None | 0 0
  1. Get-Date
  2. (Get-Date).AddDays(1)
  3. (Get-Date).AddDays(1)
  4. (Get-Date).AddHours(1)
  5. (Get-Date).AddMilliseconds(1)
  6. (Get-Date).AddMinutes(1)
  7. (Get-Date).AddMonths(1)
  8. (Get-Date).AddSeconds(1)
  9. (Get-Date).AddTicks(1)
  10. (Get-Date).AddYears(1)
  11.  
  12.  
  13.  
  14. (get-date).day
  15. (get-date).dayofweek
  16. (get-date).dayofyear
  17. (get-date).hour
  18. (get-date).millisecond
  19. (get-date).minute
  20. (get-date).month
  21. (get-date).second
  22. (get-date).timeofday
  23. (get-date).year
  24.  
  25.  
  26. new-object system.globalization.datetimeformatinfo
  27.  
  28.  
  29. get-date -format
  30.  
  31. Specifier Format Sample Output
  32. d ShortDatePattern 8/30/2007
  33. D LongDatePattern Thursday, August 30, 2007
  34. f Full date and time (long date and short time) Thursday, August 30, 20
  35. F FullDateTimePattern (long date and long time) Thursday, August 30, 2007 11:19:59 AM
  36. g General (short date and short time) 8/30/2007 11:20 AM
  37. G General (short date and long time) 8/30/2007 11:20:24 AM
  38. m, M MonthDayPattern August 30
  39. o Round-trip date/time pattern [TEXT]
  40. 2007-08-30T11:18:49.0312500-07:00 RFC1123Pattern Thu, 30 Aug 2007 11:21:36 GMT
  41. s SortableDateTimePattern (based on ISO 8601) using local time 2007-08-30T11:20:36
  42. t ShortTimePattern 11:20 AM
  43. T LongTimePattern 11:20:42 AM
  44. u UniversalSortableDateTimePattern format for universal time 2007-08-30 11:21:50Z
  45. U Full date and time (long date and long time) using universal Thursday, August 30, 2007 6:21:52 PM
  46. y, Y YearMonthPattern August, 2007
  47.  
  48. Specifier Description
  49. d. %d The day of the month. Single-digit days will not have a leading zero. Specify "%d" if the format pattern is not combined with other format patterns.
  50. dd The day of the month. Single-digit days will have a leading zero.
  51. ddd The abbreviated name of the day of the week.
  52. dddd The full name of the day of the week, as defined in DayNames.
  53. h, %h The hour in a 12-hour clock. Single-digit hours will not have a leading zero. Specify "%h" if the format pattern is not combined with other format patterns.
  54. hh The hour in a 12-hour clock. Single-digit hours will have a leading zero.
  55. H, %H The hour in a 24-hour clock. Single-digit hours will not have a leading zero. Specify "%H" if the format pattern is not combined with other format patterns.
  56. HH The hour in a 24-hour clock. Single-digit hours will have a leading zero.
  57. m, %m The minute. Single-digit minutes will not have a leading zero. Specify "%m" if the format pattern is not combined with other format patterns.
  58. mm The minute. Single-digit minutes will have a leading zero.
  59. M, %M The numeric month. Single-digit months will not have a leading zero. Specify "%M" if the format pattern is not combined with other format patterns.
  60. MM The numeric month. Single-digit months will have a leading zero.
  61. MMM The abbreviated name of the month, as defined in AbbreviatedMonthNames.
  62. MMMM The full name of the month, as defined in MonthNames.
  63. s, %s The second. Single-digit seconds will not have a leading zero. Specify "%s" if the format pattern is not combined with other format patterns.
  64. ss The second. Single-digit seconds will have a leading zero.
  65. t, %t The first character in the AM/PM designator defined in AMDesignator or PMDesignator, if any. Specify "%t" if the format pattern is not combined with other format patterns.
  66. tt The AM/PM designator defined in AMDesignator or PMDesignator, if any.
  67. y, %y The year without the century. If the year without the century is less than 10, the year is displayed with no leading zero. Specify "%y" if the format pattern is not combined with other format patterns.
  68. yy The year without the century. If the year without the century is less than 10, the year is displayed with a leading zero.
  69. yyy The year in three digits. If the year is less than 100, the year is displayed with a leading zero.
  70. yyyy The year in four or five digits (depending on the calendar used), including the century. Will pad with leading zeroes to get four digits. Thai Buddhist and Korean calendars both have five digit years; users selecting the "yyyy" pattern will see all five digits without leading zeros for calendars that have five digits. Exception: the Japanese and Taiwan calendars always behave as if "yy" was selected.
  71. %c Where c is a format pattern if used alone. That is, to use format pattern "d", "f", "F", "h", "m", "s", "t", "y", "z", "H", or "M" by itself, specify "%d", "%f", "%F", "%h", "%m", "%s", "%t", "%y", "%z", "%H", or "%M". The "%" character can be omitted if the format pattern is combined with literal characters or other format patterns.
  72. \c Where c is any character. Displays the character literally. To display the backslash character, use "\\".
Add Comment
Please, Sign In to add comment