<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>hi, it&#39;s mike</title>
    <link>https://mike.puddingtime.org/tags/timestamps/</link>
    <description>Recent content on hi, it&#39;s mike</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>mike@puddingtime.org (mike)</managingEditor>
    <webMaster>mike@puddingtime.org (mike)</webMaster>
    <copyright>© 2026, mike</copyright>
    <lastBuildDate>Fri, 01 Jun 2012 07:24:17 +0000</lastBuildDate>
    <atom:link href="https://mike.puddingtime.org/tags/timestamps/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Epochal Automator</title>
      <link>https://mike.puddingtime.org/posts/2012-06-01-epochal-automator/</link>
      <pubDate>Fri, 01 Jun 2012 07:24:17 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2012-06-01-epochal-automator/</guid>
      
      <description>When Drupal thinks of time, it thinks in Unix timestamps. That is good for computers, not so good for me when I&#39;m staring at a quick database query and just need to know when something happened, was saved, or will be updated next.
Several months back my friend Sam asked for a way to quickly convert …</description>
      <content:encoded><![CDATA[<p>When Drupal thinks of time, it thinks in Unix timestamps. That is good for computers, not so good for me when I'm staring at a quick database query and just need to know when something happened, was saved, or will be updated next.</p>
<p>Several months back my friend Sam asked for a way to quickly convert a UNIX timestamp to a human readable date. He had a snippet of Ruby he was using, so we worked out an Automator workflow to take the mouse selection and copy the converted date to the clipboard. I usually just want to see the date, not do anything with it, so here's a version that uses Growl to quickly display the converted date.  You need to have <a href="http://growl.info/">Growl</a> installed. I should also note that Growl provides Automator actions, but I couldn't get them to take input from the preceding Automator action. </p>
<p>1. Install the Ruby growl gem. This will give you the Growl command line app, too:</p>
<pre>sudo gem install ruby-growl</pre>
<p>2. Test that the command line app is working:</p>
<p><code>echo "Hello world" | growl -H localhost</code></p>
<p>3. Fire up Automator and tell it you're making a service:</p>
<div style="text-align: center; margin: 1em;">![](https://media.puddingtime.org/archive/mph.puddingbowl.org/wordpress/wp-content/uploads/2012/05/automator_service.jpg)</div>
<div style="text-align: left; margin: 1em;">4. Tell Automator your new service is receiving the selected text from any application:</div>
<div style="margin: 1em;">![](https://media.puddingtime.org/archive/mph.puddingbowl.org/wordpress/wp-content/uploads/2012/05/automator_input.jpg)</div>
<div style="margin: 1em;">5. Drag "run shell script" from the Utilities list into your workflow.</div>
<div style="margin: 1em;">6. Paste this into the shell script action you just dragged in:</div>
<div style="margin: 1em;">
<p><code>for f in "$@"<br />do<br />     date -r $f | growl -H localhost -t "Date from UNIX timestamp:"<br />done</code></p>
<p>7. Save it and remember its name. </p>
<p>8. Assign your new service a sensible keyboard shortcut:</p>
<p>8a. Open System Preferences -&gt; Keyboard and click the "Keyboard Shortcuts" tab</p>
<p>8b. Look for your service under "Text"</p>
<p>8c. Click the grayed-out word "none" next to your service, then click "add shortcut"</p>
<p>8d. Enter your shortcut</p>
<p>That's pretty much it. </p>
<p>There are a few more things you can do to customize it. In the Growl System Preferences, you can pick the style of alert for "ruby-growl," including whether or not it makes any sound and whether or not it's sticky. </p>
<p>Here's a sample:</p>
<p>![](https://media.puddingtime.org/archive/mph.puddingbowl.org/wordpress/wp-content/uploads/2012/05/growl-timestamp.jpg)</p>
</div>
<p>#automator #drupal #epoch #mac #timestamps #unix</p>
<p><em><a href="mailto:mike@puddingtime.org?subject=Re%3A%20Epochal%20Automator">Drop a line about this</a>.</em></p>]]></content:encoded>
    </item>
  </channel>
</rss>
