| View previous topic :: View next topic |
| Author |
Message |
adamrgolf
Joined: 28 Dec 2006 Posts: 355
|
Posted: Thu Aug 02, 2007 3:54 pm Post subject: Possible FormatTime Bug? |
|
|
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.
Thanks,
Adam |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 3959 Location: Pittsburgh
|
Posted: Thu Aug 02, 2007 4:01 pm Post subject: |
|
|
| 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 |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Thu Aug 02, 2007 4:03 pm Post subject: |
|
|
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 |
|
 |
adamrgolf
Joined: 28 Dec 2006 Posts: 355
|
Posted: Thu Aug 02, 2007 4:03 pm Post subject: |
|
|
thanks i guess i missed this when reading the remarks section
my bad |
|
| Back to top |
|
 |
|