Home Download Buy Blog Forum Support

InsertDate - About inserting the current date or time

InsertDate - About inserting the current date or time

Postby FichteFoll on Thu Jun 14, 2012 7:26 pm

I wrote this plugin a while ago which will insert the current (local) date or time into the view. It supports multiple selections, replacing selected text and has a variety of options like specifying the format string and binding that to a key combination.
Additionally I included the pytz lib to support named timezones. There are a bunch of examples how to use them.

I might look a bit complicated at first sight, but people using Sublime Text should get its usability soon enough.

Here is the default keymap as example:
Code: Select all
[
   // Insert datetime using default format text
   { "keys": ["f5"],                "command": "insert_date" },
   // Insert datetime using the specified format
   { "keys": ["ctrl+f5", "ctrl+d"], "command": "insert_date", "args": {"format": "%Y-%m-%d"} },
   { "keys": ["ctrl+f5", "ctrl+t"], "command": "insert_date", "args": {"format": "%X"} },
   { "keys": ["ctrl+f5", "ctrl+i"], "command": "insert_date", "args": {"format": "iso"} },
   { "keys": ["ctrl+f5", "ctrl+u"], "command": "insert_date", "args": {"format": "%x %X %Z", "tz_out": "UTC"} },
   // Prompt for user input, "format" would behave as default text
   // and insert the datetime using that format string
   { "keys": ["alt+f5"],            "command": "insert_date", "args": {"prompt": true} }
]



Link: https://github.com/FichteFoll/sublimetext-insertdate
FichteFoll
 
Posts: 313
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: InsertDate - About inserting the current date or time

Postby FichteFoll on Mon Feb 24, 2014 1:03 am

So, I just now remembered that I actually created a thread for this plugin here, so I'd like to use this to announce that InsertDate got an update some time ago.

Notable features:
- ST3 compatible
- Configurable dropdown list of commonly used formats and timezones with preview, replaces the old standard operation on "f5". Have a screenshot: http://i.imgur.com/57S5iH2.png

Keybindings: https://github.com/FichteFoll/sublimete ... ime-keymap (replace "ctrl" with "super" on OSX).
FichteFoll
 
Posts: 313
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: InsertDate - About inserting the current date or time

Postby facelessuser on Mon Feb 24, 2014 2:57 am

This has to be the most complete insert date plugin I have seen. Quite configurable. I'm going to check this out. Wonder how I missed this...
facelessuser
 
Posts: 1446
Joined: Tue Apr 05, 2011 7:38 pm


Return to Plugin Announcements

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests