Force FormatTime to use different language

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
arathra
Posts: 23
Joined: 29 Aug 2016, 06:22

Force FormatTime to use different language

05 Sep 2016, 13:55

I'm having fun with Format Time, in particular:

Code: Select all

FormatTime, vToday,, dd MMM yyyy
This works fine and returns the date in my computer language (English), e.g. 5 Sep 2016

However, is there a way I can force this to return the date in another language, e.g. in Italian it would be 5 Set 2016

I suppose I could do a search/replace but I was wondering if there's an easier way.

Thanks!
Fee
Posts: 57
Joined: 05 Aug 2016, 14:30

Re: Force FormatTime to use different language

05 Sep 2016, 14:42

https://autohotkey.com/docs/commands/Fo ... al_Options
To use a specific locale, specify the letter L followed by a hexadecimal or decimal locale identifier (LCID)
National Language Support (NLS) API Reference - https://msdn.microsoft.com/en-us/goglobal/bb896001.aspx

Example in Italian

Code: Select all

FormatTime, vToday,L0x0010, dd MMM yyyy
garry
Posts: 3795
Joined: 22 Dec 2013, 12:50

Re: Force FormatTime to use different language

05 Sep 2016, 15:54

examples

Code: Select all

;-- see locale codes for language
; https://autohotkey.com/docs/misc/Languages.htm
; http://msdn.microsoft.com/en-us/library/aa912040
; http://www.science.co.il/language/locale-codes.asp

Time := A_Now
FormatTime,Italia,%time% L1040, dd MMM yyyy
msgbox,Italia=%italia%
FormatTime,suomi, %time% L1035, dddd MMMM dd-MM-yyyy  ;-- SF 1035 suomi finland
FormatTime,here , %time%      , dddd MMMM dd-MM-yyyy  ;
msgbox,Language-Code Suomi Finland 1035 = %suomi%`nLanguage-Code my computer %a_language% = %here%
arathra
Posts: 23
Joined: 29 Aug 2016, 06:22

Re: Force FormatTime to use different language

15 Sep 2016, 10:40

Thank you! This works very well.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, Google [Bot], peter_ahk and 402 guests