 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
1itsolution
Joined: 25 Apr 2008 Posts: 3
|
Posted: Fri May 30, 2008 8:01 am Post subject: Converting month (number) to month (text)? |
|
|
My script pulls the last modified date from a particular file and returns that as a string. I then want to echo that string to screen in a user friendly format.
So, I have two variables one for the year (_AppYear = 2008) and one for the month (_AppMonth = 04 in this case). I would like the end user to see April instead of 04, or August instead of 08. I imagine I need some sort of table that my script can reference the month string against and return the appropriate month in text.
I'm sure this is very simple but being a relative noob, I'm scratching my head.
Hope someone can point me in the right direction.
Here's my portion of code so far:
| Code: |
; Checks the datestamp of a file on install disc to confirm that the user is installing the correct monthly update.
FileGetTime, _datestamp, %_FileCheckDataCab%, M
StringLeft, _AppYear, _datestamp, 4
StringMid, _AppMonth, _datestamp, 5, 2 |
|
|
| Back to top |
|
 |
Klaus
Joined: 12 May 2005 Posts: 205 Location: Münster, Germany
|
Posted: Fri May 30, 2008 8:14 am Post subject: |
|
|
Hi, 1itsolution,
try something like this
| Code: |
month05=May
; and so on ...
number=05
msgbox, % month%number%
return
|
Hope I could help,
Klaus |
|
| Back to top |
|
 |
HugoV
Joined: 27 May 2007 Posts: 650
|
Posted: Fri May 30, 2008 8:30 am Post subject: |
|
|
Look into FormatTime
| Code: | FileGetTime, _datestamp, %A_ScriptDir%\%A_ScriptName%, M
FormatTime, _Displaydatestamp, %_datestamp%, dd MMM yyyy
MsgBox % _Displaydatestamp |
|
|
| Back to top |
|
 |
1itsolutution Guest
|
Posted: Fri May 30, 2008 8:38 am Post subject: |
|
|
| Thank you both I will try these now. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|