Guest User

Untitled

a guest
Oct 16th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.63 KB | None | 0 0
  1. MsgBox("", "derp", BuildDateTime())
  2.  
  3. Func GetMonth()
  4.    Local $m = @MON
  5.    Select
  6.       Case $m = "01"
  7.          Return "January"
  8.       Case $m = "02"
  9.          Return "February"
  10.       Case $m = "03"
  11.          Return "March"
  12.       Case $m = "04"
  13.          Return "April"
  14.       Case $m = "05"
  15.          Return "May"
  16.       Case $m = "06"
  17.          Return "June"
  18.       Case $m = "07"
  19.          Return "July"
  20.       Case $m = "08"
  21.          Return "August"
  22.       Case $m = "09"
  23.          Return "September"
  24.       Case $m = "10"
  25.          Return "October"
  26.       Case $m = "11"
  27.          Return "November"
  28.       Case $m = "12"
  29.          Return "December"
  30.       EndSelect
  31. EndFunc
  32.    
  33. Func GetDay()
  34.    Local $d = @WDAY
  35.    
  36.    Select
  37.       Case $d = "1"
  38.          Return "Sunday"
  39.       Case $d = "2"
  40.          Return "Monday"
  41.       Case $d = "3"
  42.          Return "Tuesday"
  43.       Case $d = "4"
  44.          Return "Wednesday"
  45.       Case $d = "5"
  46.          Return "Thursday"
  47.       Case $d = "6"
  48.          Return "Friday"
  49.       Case $d = "7"
  50.          Return "Saturday"
  51.    EndSelect
  52.    
  53. EndFunc
  54.  
  55. Func GetNumericDay()
  56.    
  57.    Local $d = StringRight(@WDAY, 1) + 1
  58.    Select
  59.    Case $d = "1"
  60.       Return @WDAY + 1 & "st"
  61.    Case $d = "2"
  62.       return @WDAY + 1 & "nd"
  63.    Case $d = "3"
  64.       Return @WDAY + 1 & "rd"
  65.    EndSelect
  66.    
  67.    Return @WDAY + 1 & "th"
  68.    
  69. EndFunc
  70.  
  71. Func BuildTime()
  72.    
  73.    Local $time = @HOUR
  74.    Local $end = "AM"
  75.      
  76.    If $time = 12 Then
  77.       $end = "PM"
  78.    EndIf
  79.    
  80.    If $time = 0 Then
  81.       $time = 12
  82.    EndIf
  83.    
  84.    If $time > 12 Then
  85.       $end = "PM"
  86.       $time = $time - 12
  87.    EndIf
  88.    
  89.    Return $time & ":" & @MIN & " " & $end
  90.    
  91. EndFunc
  92.  
  93. Func BuildDateTime()
  94.    Return GetDay() & ", " & GetMonth() & " " & GetNumericDay() & " " & @YEAR & " at " & BuildTime()
  95. EndFunc
Add Comment
Please, Sign In to add comment