Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Leading zeros not appearing in Month and Day in FormatTime function.


  • Please log in to reply
3 replies to this topic
Xanth
  • Members
  • 1 posts
  • Last active: Feb 03 2014 06:48 PM
  • Joined: 03 Feb 2014

Currently using version: v1.1.14.02

Here is my function call 

  FormatTime, iTime, MMddYYYY, ShortDate

I send it in simple output: Send %iTime%

 

Creates the following result when using 
 

2/3/2014

 

According to the documentation, this should add a two digit month and a two digit day.  Neither of which is happening.

I was wondering if anyone had an explanation for this.

 

Thank you for your time and attention.

 



kon
  • Members
  • 1652 posts
  • Last active:
  • Joined: 04 Mar 2013

I can't reproduce this.
Also the second parameter is meaningless. It should be a timestamp or blank, correct?

Win 7
1.1.14.02



HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

This happens if format in Regional and Language is  English (United States), works fine if it is English (United Kingdom).

 

Docs are not saying anything about leading 0's, also read more about it on MSDN

FormatTime, iTime, %A_Now%, ShortDate
MsgBox % iTime


Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

 

Short date representation for the current user's locale, such as 02/29/04

 

"for the current user's locale" means it depends on your locale settings.  "such as" means it's an example of what a result can be, not that every result will have the same format.  On this XP system, Regional and Language Options shows the Short Date format as "4/02/2014", which is also what HotKeyIt's code produces.  I think this is the default for "English (Australia)", but you can also customize it.