AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Possible FormatTime Bug?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
adamrgolf



Joined: 28 Dec 2006
Posts: 355

PostPosted: Thu Aug 02, 2007 3:54 pm    Post subject: Possible FormatTime Bug? Reply with quote

FormatTime, maybeBug, , hhMMss
msgbox % maybeBug
FormatTime, noBug, , sshhMM
msgbox % noBug

I know MM is a month stamp - I found this in error. How come the seconds won't show up after the month, but they will show up before the MM?

If this isn't a bug could someone explain why, I'm curious now. Smile

Thanks,

Adam
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 3959
Location: Pittsburgh

PostPosted: Thu Aug 02, 2007 4:01 pm    Post subject: Reply with quote

Help wrote:
If Format contains date and time elements together, they must not be intermixed. In other words, the string should be dividable into two halves: a time half and a date half. For example, a format string consisting of "hh yyyy mm" would not produce the expected result because it has a date element in between two time elements
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Thu Aug 02, 2007 4:03 pm    Post subject: Reply with quote

This is a documented limitation:
Quote:
If Format contains date and time elements together, they must not be intermixed. In other words, the string should be dividable into two halves: a time half and a date half. For example, a format string consisting of "hh yyyy mm" would not produce the expected result because it has a date element in between two time elements.
This limitation exists because FormatTime internally combines two WinAPI functions. The code needed to allow multiple calls to those two functions (instead of a maximum of one call each) would be larger and more complex. Therefore, given the rarity of the need, it didn't seem worth it.
Back to top
View user's profile Send private message Send e-mail
adamrgolf



Joined: 28 Dec 2006
Posts: 355

PostPosted: Thu Aug 02, 2007 4:03 pm    Post subject: Reply with quote

thanks Smile i guess i missed this when reading the remarks section

my bad
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group