-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomator-service-copy-current-utc-timestamp-clipboard.html
154 lines (137 loc) · 7.72 KB
/
automator-service-copy-current-utc-timestamp-clipboard.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<!DOCTYPE html>
<html lang="en">
<head>
<title>Automator Service: Copy Current UTC Timestamp to Clipboard | Undefined Value</title>
<meta charset="utf-8" />
<link href="https://undefinedvalue.com/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Undefined Value Full Atom Feed" />
<link href="https://undefinedvalue.com/atom.xml" type="application/atom+xml" rel="alternate" title="Undefined Value Atom Feed" />
<link href="https://undefinedvalue.com/rss.xml" type="application/rss+xml" rel="alternate" title="Undefined Value RSS Feed" />
<link href="https://undefinedvalue.com/feeds/{slug}.atom.xml" type="application/atom+xml" rel="alternate" title="Undefined Value Categories Atom Feed" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="//fonts.googleapis.com/css?family=Oswald%7CLato%7CInconsolata" rel="stylesheet">
<link rel="stylesheet" href="https://undefinedvalue.com/theme/css/normalize.css" />
<link rel="stylesheet" href="https://undefinedvalue.com/theme/css/skeleton.css" />
<link rel="stylesheet" href="https://undefinedvalue.com/theme/css/highlight.css" />
<link rel="stylesheet" href="https://undefinedvalue.com/theme/css/style.css" />
<link rel="icon" type="image/png" href="images/favicon.png" />
<meta name="tags" content="automator" />
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-43697246-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body id="index" class="home">
<div class="container">
<div class="row">
<div class="logo">
<a href="https://undefinedvalue.com/">
<img src="https://undefinedvalue.com/theme/images/undefinedvalue_logo.png" alt="Logo">
</a>
</div><!-- /.logo -->
<header id="banner" class="body">
<h1><a href="https://undefinedvalue.com/">Undefined Value</a></h1>
<strong>Kris Johnson's Blog</strong>
</header><!-- /#banner -->
</div><!-- /.row -->
<div class="row">
<nav id="menu"><ul>
<li><a href="/">Front Page</a></li>
<li><a href="/tags.html">Tags</a></li>
<li><a href="/archives.html">Archives</a></li>
<li><a href="https://undefinedvalue.com/pages/about-me.html">About Me</a></li>
<li><a href="https://undefinedvalue.com/pages/kjresume.html">My Résumé</a></li>
<li><a href="https://undefinedvalue.com/search.html">Search</a></li>
</ul></nav><!-- /#menu -->
</div><!-- /.row -->
<div class="row">
<div class="nine columns">
<section id="content" class="body">
<header>
<h2 class="entry-title">
<a href="https://undefinedvalue.com/automator-service-copy-current-utc-timestamp-clipboard.html" rel="bookmark"
title="Permalink to Automator Service: Copy Current UTC Timestamp to Clipboard">Automator Service: Copy Current UTC Timestamp to Clipboard</a></h2>
</header>
<footer class="post-info">
<time class="published" datetime="2009-11-10T00:12:31-05:00">
2009-11-10
</time>
<ul class="tags">
<li><a class="tag" href="https://undefinedvalue.com/tag/automator.html">automator</a></li>
</ul>
</footer><!-- /.post-info -->
<div class="entry-content">
<p>Yeah, I know, you're probably getting sick of these Automator services. But I really do create a new one of these practically every day to make my life a little easier, and maybe some of these will be useful to others.</p>
<p>This one puts a UTC timestamp on the clipboard. The timestamp is an <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a>-format string like "2009-11-09T13:14:03Z". If you'd like a different format, type "man date" in Terminal to see how to change the output format of the <code>date</code> command in the shell script below.</p>
<!--break-->
<h2>How to Use It</h2>
<p>Choose <strong>Copy Current UTC Timestamp to Clipboard</strong> from the Services menu, then paste it into wherever you need it.</p>
<h2>How to Make it</h2>
<ol>
<li>Start up Automator, and create a new Service which takes <strong>no input</strong> in <strong>any application</strong></li>
<li>Add a <strong>Run Shell Script</strong> action, with shell <strong>/bin/bash</strong> and which passes input <strong>to stdin</strong>. Replace the shell script text with this:<pre>
<br>/bin/date -u '+%FT%TZ'<br></pre></li>
<li>Add a <strong>Copy to Clipboard</strong> action.</li>
<li>Choose <strong>File -> Save</strong> and name it "Copy Current UTC Timestamp to Clipboard"</li>
</ol>
<p><img src="https://undefinedvalue.com/sites/undefinedvalue.com/files/Copy_UTC_Timestamp_to_Clipboard.png" alt="Screenshot"></p>
</div><!-- /.entry-content -->
</section>
<ul>
<li>Previous article:
<a href="https://undefinedvalue.com/authenticating-google-app-engine.html">
Authenticating with Google App Engine
</a>
</li>
<li>Next article:
<a href="https://undefinedvalue.com/introducing-kids-programming.html">
Introducing Kids to Programming
</a>
</li>
</ul>
</div><!-- /.nine columns -->
<div class="three columns">
<section id="extras" class="body">
<div class="recent">
<h2>Recent Posts</h2>
<ul>
<li><a href="https://undefinedvalue.com/simpler-résumé-updates.html">Simpler Résumé Updates</a></li>
<li><a href="https://undefinedvalue.com/54.html">54</a></li>
<li><a href="https://undefinedvalue.com/53.html">53</a></li>
<li><a href="https://undefinedvalue.com/menubar-countdown-21.html">Menubar Countdown 2.1</a></li>
<li><a href="https://undefinedvalue.com/lunar-for-c-and-rust.html">LUNAR for C and Rust</a></li>
</ul>
</div><!-- ./recent -->
<div class="blogroll">
<h2>Other Stuff</h2>
<ul>
<li><a href="http://secretspacelab.com/tcm.html">What's Good on TCM?</a></li>
<li><a href="https://github.com/kristopherjohnson">GitHub</a></li>
<li><a href="https://bitbucket.org/KristopherJohnson/">Bitbucket</a></li>
</ul>
</div><!-- /.blogroll -->
<div class="social">
<h2>Follow</h2>
<ul>
<li><a href="https://undefinedvalue.com/feeds/all.atom.xml" type="application/atom+xml" rel="alternate">Atom Feed</a></li>
<li><a rel="me" href="https://mastodon.xyz/@oldmankris">Mastodon</a></li>
<li><a rel="me" href="http://stackoverflow.com/users/1175/kristopher-johnson">Stack Overflow</a></li>
<li><a rel="me" href="http://www.linkedin.com/in/kristopherdjohnson">LinkedIn</a></li>
<li><a rel="me" href="https://www.flickr.com/photos/kristopherjohnson/">Flickr</a></li>
<li><a rel="me" href="http://twitter.com/OldManKris">Twitter</a></li>
</ul>
</div><!-- /.social -->
</section><!-- /#extras -->
</div><!-- /.three columns -->
</div><!-- /.row -->
<div class="row">
<footer id="contentinfo" class="body">
© 2003-2023 Kristopher Johnson
</footer><!-- /#contentinfo -->
</div><!-- /.row -->
</div><!-- /.container -->
</body>
</html>