Author Topic: Formatting the date in alias expansion  (Read 5763 times)

parrish1

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Formatting the date in alias expansion
« on: July 13, 2006, 04:39:04 pm »
Hello,

I have inserted a date in an alias expansion using %\d
Is there a way to alter/choose the format of the date that is inserted?
I would really like to have YYYYMMDD instead of MM/DD/YYYY

Thanks
Tim

jbezem

  • Community Member
  • Posts: 85
  • Hero Points: 8
Re: Formatting the date in alias expansion
« Reply #1 on: July 14, 2006, 05:54:26 am »
According to the source code (alias.e, expand_alias_line()), the builtin function _date is used with the option 'L' (locale dependent date format).
If you are on Windows, this should be easily changed by changing your date settings for Windows itself (short date settings) to the desired format. If not on Windows, some extra tweaking will be necessary.

HTH,

Johan

parrish1

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Re: Formatting the date in alias expansion
« Reply #2 on: July 14, 2006, 03:18:15 pm »
Johan,

Changing the date settings for Windows does alter the result from alias expansion, thanks.
However, I don't really want that format for everything on my system.  :(
I would prefer the ability to specify the format I want within the alias definition.
Sounds like this is becoming a feature request  :)

Thanks again for your suggestion...now that you have pointed me to alias.e, I will see if I can tweak it myself to get the format I want. :)

Tim