Cynosure.X International

: :

Add Comment | Related Links | TrackBack
Related Content

SortableDate.sh (GPL)

"SortableDate.sh" is a Bourne shell script that outputs the current date and time in a sortable format. It's excellent for creating time-based file names.

"SortableDate.sh" takes advantage of the following shell scripts, which are also available on this site. So to use the this script, you will need to download these other scripts if you don't already have them.

MonthToNumeric.sh
NumberToString.sh
Token.sh

"SortableDate.sh" is distributed as executable source code under the GNU General Public License. Please see the license agreement elsewhere on this site.

Usage

SortableDate.sh [ -f ] [ -u ]

Specify "-f" to format the display without special symbols.

Specify "-u" to display the output in UTC (Coordinated Universal) time.

Examples

$ SortableDate.sh 
2009/04/21 00:43:04

$ SortableDate.sh -f
20090421_00:43:07

$ SortableDate.sh -u
2009/04/21 07:43:10

$ SortableDate.sh -f -u
20090421_07:43:18

Attached File: SortableDate.sh (1 KB)

Chieh Cheng
Tue, 21 Apr 2009 07:45:43 +0000

I modified "SortableDate.sh" so that when you issue the "-f" flag, it would output time without the ':' symbol. Somehow, I had forgotten to implement that last time. the new version is attached below.

Examples

$ SortableDate.sh 
2009/04/21 00:43:04

$ SortableDate.sh -f
20090421_004307

$ SortableDate.sh -u
2009/04/21 07:43:10

$ SortableDate.sh -f -u
20090421_074318

Attached File: 1 - SortableDate.sh (1 KB)

Chieh Cheng
Tue, 02 Jun 2009 01:11:19 +0000

Add Comment | Related Links | TrackBack
Related Content

Did your message disappear? Read the Forums FAQ.

Add Comment

Spam Control | * indicates required field
Your Name: *
E-mail:
Remember Me!
Comment: *
File attachment is optional. Please do not attach a file to your submission unless it is relevent.
Attach File:
(20 MB Max)
Spam Protection: * Answer of 10 - 10?
Click button only once, please!

TrackBack

Send Ping | TrackBack URL | Spam Control

No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here.

Messages, files, and images copyright by respective owners.

Products | Services
Forums | Latest | RSS
Library | Search | Wiki
Help | Licenses

Login | Register

17 Users Online

Hacking Digital Cameras
Fun for Photographers


Amazon Associate

Copyright © 1996 - 2017. All Rights Reserved.