iEnno Posted March 31, 2013 Posted March 31, 2013 (edited) I created a workflow to display the current date and time in a configurable format. Pressing enter will copy to clipboard. You can also add and subtract time. Examples: date 3w: today + 3 weeks date -2y: today - 2 years date 2m -5d: today + 2 months - 5 days View GitHub for more details. Direct Download. Edited March 31, 2013 by iEnno DJay, Tyler Eich, Domenic and 2 others 5
Domenic Posted April 1, 2013 Posted April 1, 2013 Doesn´t work for me: Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in - on line 2 April 1, 2013 – 14:39 Do you have any ideas? I found this workflow over your (german) RSS feed. Nice one, i like it! Domenic
kopischke Posted April 1, 2013 Posted April 1, 2013 Very nice idea, but wouldn’t it be much simpler (not to mention probably both faster and less prone to PHP warnings) to use the POSIX date utility that ships with OS X?
alexkli Posted April 4, 2013 Posted April 4, 2013 I get the same error as Domenic all the time: "Warning: date(): It is not safe to rely on the system's timezone settings"
twinpeaks Posted April 5, 2013 Posted April 5, 2013 Whatever PHP error it gives just export that timezone in the 'date' script filter, just place above the one line of code... like so: export TZ="America/New_York" ruby date.rb "{query}" Domenic 1
twinpeaks Posted April 6, 2013 Posted April 6, 2013 Love the idea, but same error here Even if you export the the timezone like I mentioned in the post above yours? Should work fine...
iEnno Posted April 6, 2013 Author Posted April 6, 2013 All these PHP error kind of bug me, because I thought they are due to wrong php.ini settings when using PHP >=5.3. Will fix that as soon as I find a minute. Very nice idea, but wouldn’t it be much simpler (not to mention probably both faster and less prone to PHP warnings) to use the POSIX date utility that ships with OS X? Thanks for the suggestion. Obviously didn't know about it. Will have a look into.
Domenic Posted April 6, 2013 Posted April 6, 2013 Whatever PHP error it gives just export that timezone in the 'date' script filter, just place above the one line of code... like so: export TZ="America/New_York" ruby date.rb "{query}" Thank you! Now it´s working!
twinpeaks Posted April 6, 2013 Posted April 6, 2013 Thank you! Now it´s working! No problem, thank iEnno for the workflow!
iEnno Posted April 6, 2013 Author Posted April 6, 2013 (edited) I built a new version using kopischke's suggestion which increases speed dramatically. You should be able to update it via alleyoop. If that won't work, please report back and use the link in the first post of this topic ("Direct Download"). From now on in order to configure the date output you have to use strftime syntax. The Workflow should migrate your current setting automatically. Please report back if there are any problems. Once again: thanks for all suggestions and error reports. Edit: the timezone fixes shouldn't be necessary anymore. Edited April 6, 2013 by iEnno
tschoof Posted May 12, 2013 Posted May 12, 2013 I kinda wanna make a hotkey that directly shows the date and time in large type, but my attempts end in the script itself being shown – could somebody help me out here? Thanks, much appreciated
tschoof Posted May 13, 2013 Posted May 13, 2013 Have a look at this. Is this what you need? Exactly it, thanks Any chance to combine the same date format customization options there?
iEnno Posted May 13, 2013 Author Posted May 13, 2013 (edited) Any chance to combine the same date format customization options there? 1. Open the Workflow in Alfred Preferences 2. Double-Click the "Run Script" action 3. Add your format, i.e. date +"%B %d, %Y" The +-sign says "here comes a format", double quotes wrap it and the actual characters with the %-sign appended have a specific meaning. The possible characters for the format scan be looked up on http://strfti.me/, Edited May 13, 2013 by iEnno
tschoof Posted May 13, 2013 Posted May 13, 2013 1. Open the Workflow in Alfred Preferences 2. Double-Click the "Run Script" action 3. Add your format, i.e. date +"%B %d, %Y" The +-sign says "here comes a format", double quotes wrap it and the actual characters with the %-sign appended have a specific meaning. The possible characters for the format scan be looked up on http://strfti.me/, Thanks a million
freyherme Posted April 4, 2014 Posted April 4, 2014 Is there any way to make this workflow calculate from a future date/time? I'd like to be able to enter some date/time in the future and then add/subtract time from that date. Any way to do this? Thanks!
iEnno Posted April 7, 2014 Author Posted April 7, 2014 Is there any way to make this workflow calculate from a future date/time? I'd like to be able to enter some date/time in the future and then add/subtract time from that date. Any way to do this? Thanks! Currently there is no way to achieve what you want, but it would surely be useful though. I will try to make some time to implement it, but don't expect it anytime soon. I will let you know when it's ready.
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