A_DDD = Sa

Report problems with documented functionality
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

A_DDD = Sa

13 Jan 2018, 03:33

2018-01-13 09_29_44-window_event_listener.ahk - SciTE4AutoHotkey.png
2018-01-13 09_29_44-window_event_listener.ahk - SciTE4AutoHotkey.png (10.1 KiB) Viewed 2471 times
A_DDD = Sa Current day of the week's 3-letter abbreviation in the current user's language, e.g. Sun

msg = A_DDD = %A_DDD% Current day of the week's 3-letter abbreviation in the current user's language, e.g. Sun
Clipboard := msg
ToolTip,% msg
gregster
Posts: 8916
Joined: 30 Sep 2013, 06:48

Re: A_DDD = Sa

13 Jan 2018, 09:55

You seem to be in Germany, so 'Sa' for 'Samstag' seems to be the right output for today, assuming you are also running a german Windows... well, german windows uses 2-letter abbreviations, that is true.
So, I would rather consider that something for the "Improve the documentation" thread than a bug, because AHK just replicates information which it gets from the system. Since A_DDDD gets you the complete name and A_DD the 2-digit day of the month (01-31), A_DDD is the way to go to get the abbreviaton.

Btw, in the current online docs I only read "Current day of the week's abbreviation in the current user's language, e.g. Sun", nothing about "3-letter" anyway, if that is your concern. Correction: in v2 alpha docs (in english language) I can find "3-letter", german docs make no mention of the expected number, but give a 2-letter example, both in v1 and v2.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: A_DDD = Sa

13 Jan 2018, 18:48

- Here's an example to give you the weekday/month in English.

Code: Select all

q:: ;get weekday and month in English
;note: AutoHotkey uses 1-7 for Sun-Mon (not 0-6)
oMonth := StrSplit("January,February,March,April,May,June,July,August,September,October,November,December", ",")
oMonth3 := StrSplit("Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", ",")
oDay := StrSplit("Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday", ",")
oDay3 := StrSplit("Sun,Mon,Tue,Wed,Thu,Fri,Sat", ",")

MsgBox, % oMonth[A_MM] "`r`n" oMonth3[A_MM]
MsgBox, % oDay[A_WDay] "`r`n" oDay3[A_WDay]

vDate := A_Now
FormatTime, vWDay, % vDate, WDay
FormatTime, vMM, % vDate, MM
FormatTime, vDate, % vDate, % "'" oDay3[vWDay] "' dd '" oMonth3[vMM] "' yyyy HH:mm:ss"
MsgBox, % vDate
return
- I've also added this example here:
jeeswg's documentation extension tutorial - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=33596
- I would suppose that this example could easily be adapted for use with other languages.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
gregster
Posts: 8916
Joined: 30 Sep 2013, 06:48

Re: A_DDD = Sa

13 Jan 2018, 21:36

jeeswg wrote:- Here's an example to give you the weekday/month in English.
I don't think that this was the scope of the question... or bug report. But who nows... there was not much of a question or a report, anyway. After all, I guess it won't hurt - obviously, it is no problem to shorten or expand the info the system gives you to whatever you like.
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: A_DDD = Sa

20 Jan 2018, 16:03

gregster wrote:
jeeswg wrote:- Here's an example to give you the weekday/month in English.
I don't think that this was the scope of the question... or bug report. But who nows... there was not much of a question or a report, anyway. After all, I guess it won't hurt - obviously, it is no problem to shorten or expand the info the system gives you to whatever you like.
Yes its not prob for me to create a simple workaround.
For me it shows like a very little bug. A_DDD means for me the first 3 letters of the day :) thats all. i tried to report that. i have not a big problem with it.may in a year i forgot this discussion and then i havt this trouble again ;) so if you have time and fun please change it or rename the variable. thanks. and ahk is great :thumbup: yeaaah
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

Re: A_DDD = Sa

20 Jan 2018, 17:03

jeeswg wrote:- Here's an example to give you the weekday/month in English.....
Can you explain: What is the purpose of this example? Please excuse my confused ingnorance.

Edit: Thanks, I understand that jeeswg.
Last edited by derz00 on 20 Jan 2018, 17:34, edited 1 time in total.
try it and see
...
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

Re: A_DDD = Sa

20 Jan 2018, 17:05

SL5 wrote: A_DDD means for me the first 3 letters of the day :) thats all.
But as gregster said, in German the abbreviations are 2-letters. AHK uses the abbreviation of the current language, it doesn't decide that itself.
try it and see
...
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: A_DDD = Sa

20 Jan 2018, 17:07

- I had considered doing something like that before, but hadn't really had the need.
- Two things. One, it's a template, if you want to use some variant text for weekdays/months, e.g. fewer/more letters, or capitalisation. Two, it's a template, if you want to use more than one language in your script, or don't want to use the default language.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: A_DDD = Sa

20 Jan 2018, 18:34

Hello people, I have and just want to describe how I am reading it. I read in the documentary and there is DDD so I for me the first three characters. It's that simple. Intuitively, that's what it's like. AHK starts here automatically in German. That's just it. It will be the same with many others. Just the native language.
For me it seems normal that one first thinks of the first three characters in DDD. I like it when the first, the Intuitive thought fits. I gave the feedbank the way I did it and maybe it'll happen to me again if I do not think about it again first. Sure, you can just use A_DDDD and substring or something. No problem. So it seemed to me bug. If this just passes through the system default, then it's a little different than what I thought. Intuitively, I think you think differently. right? There are certainly more important thinks to do. And if it stays that way, it does not matter. What the hell. However, it would probably be no great effort to change that. I personally would like that. As then it is just not a bug, just slightly wrong to understand ;)

But on the other hand, e.g. DDDD equal to "Sams" no. And did I expect that? Honestly no. Oops. My inutuity is not quite consistent then. :silent: :think: so iam wrong
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

Re: A_DDD = Sa

22 Jan 2018, 09:17

SL5 wrote: There are certainly more important thinks to do.
Right. :lol:

But probably this should be clarified in the documentation.
try it and see
...
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: A_DDD = Sa

23 Jan 2018, 13:31

derz00 wrote:
SL5 wrote: A_DDD means for me the first 3 letters of the day :) thats all.
But as gregster said, in German the abbreviations are 2-letters. AHK uses the abbreviation of the current language, it doesn't decide that itself.
Not necessarily. In German, it's also valid to use the three character option (while those are often used with capitalized characters) therefore I would agree with derz00 to expect the three character format if A_DDD is used.
  • 'Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'
    'Son','Mon','Die','Mit','Don','Fre','Sam'
    'So','Mo','Di','Mi','Do','Fr','Sa'
gregster
Posts: 8916
Joined: 30 Sep 2013, 06:48

Re: A_DDD = Sa

23 Jan 2018, 13:48

Of course it is 'valid', but it is not what MS Windows uses.
How should AHK know what are common 3-letter abbreviations in all localizations of Windows? In german, you can use the first three letters but there might be languages where it is not unambiguous to do so, or you could get uncommon abbreviations.

Therefore, I think it is best to go with the system standard and let the user change that by a self-written function or an associative array, if needed, instead of messing around with the localization settings, especially if all standard windows calendars still display two letters in german windows (like in the system tray and the MonthCal GUI element).

Also, like it was mentioned, A_DDDD doesn't give you a 4-letter abbreviation either. And the only docs which talk about 3-letter abbreviations are the english v2 docs, anyway, which are in alpha stage... and A_DD finally gives you no letter abbreviation at all.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 21 guests