thelitigator Posted May 12 Share Posted May 12 Hello all, first time poster here with what I suspect is a dumb question, but it's mystifying me. I want to have a snippet that expands to the current date in yy-mm-dd format. I have a snippet set up to that effect with the following snippet formula: {date:yy-mm-dd} The problem is that it the expansion is making strange random mistakes! For example, I opened a word doc, and it expanded to the date 24-03-12. Then I opened an Outlook email, and it expanded to 24-06-12! This is so strange! I checked and my system date and time on my mac computer are correct. Can anyone give me an idea why this is happening? Thanks much! Link to comment
Stephen_C Posted May 12 Share Posted May 12 Welcome to the forum. I think we need to check whether the MS apps are themselves doing strange things with date strings (for example, applying their own substitutions). Just to check, open TextEdit and expand the snippet there. Does that work properly? Stephen Link to comment
thelitigator Posted May 12 Author Share Posted May 12 Thanks very much for your response! So, it gets even stranger ... When I used the snippet in TextEdit, it output "24-13-12" (!) Link to comment
Stephen_C Posted May 13 Share Posted May 13 Try using this for your Snippet: {isodate: YY-MM-dd} For an explanation see this Alfred help page: ISO Date and Time Placeholders. Stephen Link to comment
thelitigator Posted May 13 Author Share Posted May 13 That worked. Thanks so much for your help! Link to comment
Vero Posted May 13 Share Posted May 13 @thelitigator A minor adjustment to @Stephen_C's suggestion will be to make the year element of the date lowercase yy instead of uppercase, as the lower case is what we think of as the year, whereas the YY alternative refers to the "week of year", meaning you may get strange results in the first week of the year. As such, your placeholder would use yy-MM-dd for year, month and date in the format you had in mind Cheers, Vero Stephen_C and thelitigator 2 Link to comment
thelitigator Posted May 13 Author Share Posted May 13 Just made that adjustment, thank you! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now