Applications that paste the date? [resolved]

Any other tech-related topics
Message
Author
User avatar
webfork
Posts: 10818
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Applications that paste the date? [resolved]

#1 Post by webfork »

We have so many copy+paste programs, but do any of them that easily pastes the current date? I'm specifically YYYY-MM-DD since that's the easiest to browse by date alone in a directory, but from experience that's not a common ask.

Suggestions welcome.

UPDATE: This question was resolved. Jump to the post describing the resolution.

User avatar
Witchiepoo
Posts: 5
Joined: Thu Jun 29, 2017 9:05 am

Re: Applications that paste the date?

#2 Post by Witchiepoo »

Hello my pretty,

What do you want/require?
  1. Do you require a general-purpose clipboard-manager but with that particular extra functionality?
    Or
  2. Would a really, really simple program that just puts the current date in yyyy-mm-dd format into the clipboard ready for pasting suffice?
If 2, this can be achieved in AutoIt with: ClipPut(@YEAR & "-" & @MON & "-" & @MDAY)
(compiled)

It can be done in AutoHotkey with: FormatTime, Clipboard,, yyyy-MM-dd
(compiled)

Midas' command-line idea (fourth post below) could be extended by saving the command-line instructions as a .bat file and, then, converting it to a very small .exe file with Bat to Exe Converter.

Another possibilty is TimeStamp (at http://www.donationcoder.com/Software/S ... #TimeStamp), which sits in the system tray and "copies user-defined times and dates to the clipboard".

If 1, smaragdus's suggestion (third post below) looks really good to me.

Eeee! Hee-hee-heeeeee!
Last edited by Witchiepoo on Thu Jul 13, 2017 7:23 am, edited 53 times in total.

Specular
Posts: 443
Joined: Sun Feb 16, 2014 10:54 pm

Re: Applications that paste the date?

#3 Post by Specular »

If you're using Autohotkey already for anything you could also simply add such additional functionality. Function found online, mixed with an example trigger, in this case I set it replace the string !date! with the date in your format whenever typed but the trigger can be substituted for anything:

Code: Select all

:*?:!date!::
FormatTime, CurrentDateTime,, yyyy-MM-dd
SendInput %CurrentDateTime%
return
Nice thing here is you can type it out in any text field and it simply replaces the trigger word with the result.


User avatar
smaragdus
Posts: 2120
Joined: Sat Jun 22, 2013 3:24 am
Location: Aeaea

Re: Applications that paste the date?

#5 Post by smaragdus »

Clibor has a time/date macro:

Image

Image

which can added to "Set Phrases":

Image

minipad2 has "Template":

Image

and time/date template can be added with global shortcut key:

Image

User avatar
Midas
Posts: 6710
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: Applications that paste the date?

#6 Post by Midas »

A little command line fu to make it all the more interesting: :twisted:
You can even do a little massaging to the figure:
  • Code: Select all

    > SET TODAY=%date:-=%
    > ECHO %TODAY%
    > 20170707
    [/medium]
This will work if your system's date is already in ISO format, plus it will strip the date '-' separator... then to get it into the clipboard, see this: https://www.howtogeek.com/howto/28473/h ... clipboard/. :mrgreen:

User avatar
__philippe
Posts: 687
Joined: Wed Jun 26, 2013 2:09 am

Re: Applications that paste the date?

#7 Post by __philippe »

@Midas

Thanks for unearthing the neat "CLIP" command line tip...first time ever I heard about it.

...which goes to nicely refute the proverbial saw "Can't teach an old dog new tricks" ... :roll:

Code: Select all

CLIP

Description:
    Redirects output of command line tools to the Windows clipboard.
    This text output can then be pasted into other programs.

Parameter List:
    /?                  Displays this help message.

Examples:
    DIR | CLIP          Places a copy of the current directory
                        listing into the Windows clipboard.

    CLIP < README.TXT   Places a copy of the text from readme.txt
                        on to the Windows clipboard.
[/medium]

PS
Also very much like Specular's above suggestion about using a terse AHK macro solution
Last edited by __philippe on Fri Jul 07, 2017 11:19 am, edited 1 time in total.

User avatar
Midas
Posts: 6710
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: Applications that paste the date?

#8 Post by Midas »

Don't mention it... :)

User avatar
lintalist
Posts: 434
Joined: Sat Apr 19, 2014 12:52 am
Contact:

Re: Applications that paste the date?

#9 Post by lintalist »

Lintalist has a date "plugin" as well which can be assigned to a hotkey or shorthand :wink:
http://lintalist.github.io/#datetime-plugin
There is also a Calendar so you can pick a date
http://lintalist.github.io/#calendar-plugin

User avatar
lintalist
Posts: 434
Joined: Sat Apr 19, 2014 12:52 am
Contact:

Re: Applications that paste the date?

#10 Post by lintalist »

Ok one more. Clipjump https://www.portablefreeware.com/?id=2523 users can develop their own plugins as well if they are familiar with AHK, so it should be possible to write a "Date" plugin and use it in Clipjump.

User avatar
webfork
Posts: 10818
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Re: Applications that paste the date?

#11 Post by webfork »

This is a fantastic response. Thanks everyone for coming back with something! Now to start digging through the remarkable number of options...

User avatar
smaragdus
Posts: 2120
Joined: Sat Jun 22, 2013 3:24 am
Location: Aeaea

Re: Applications that paste the date?

#12 Post by smaragdus »

One can add Paste Current Date and Time command to CopyQ.

Instructions
  • Create an empty INI file with the name paste-current-date-time.ini;
  • Paste the following content;

    Code: Select all

    Paste the following lines:
    [Command]
    Command="
    copyq:
    var time = dateString('yyyy-MM-dd hh:mm:ss')
    copy('Current date/time is ' + time)
    paste()"
    GlobalShortcut=meta+alt+t
    Icon=\xf017
    Name=Paste Current Time
    this is the original INI, you may modify this line:

    Code: Select all

    copy('Current date/time is ' + time)
    to

    Code: Select all

    copy(time)
    so the command will look like this:

    Code: Select all

    [Command]
    Command="
    copyq:
    var time = dateString('yyyy-MM-dd hh:mm:ss')
    copy(time)
    paste()"
    GlobalShortcut=meta+alt+t
    Icon=\xf017
    Name=Paste Current Time
  • Save the INI file;
  • Open CopyQ main window;
  • Go to File and choose Commands/Global Shortcuts;
  • Use Load Commands;
  • Load paste-current-date-time.ini file;
  • Choose global shortcut for the command;
Image

Image

Links
Paste Current Date and Time
paste-current-date-time.ini
Useful commands for CopyQ clipboard manager
Global commands

User avatar
webfork
Posts: 10818
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Re: Applications that paste the date?

#13 Post by webfork »

smaragdus wrote:One can add Paste Current Date and Time command to CopyQ
This is great news. I only just this week started testing some of the options detailed in this conversation and was looking for a reason to make a go of CopyQ. Thanks for the detailed suggestion.

User avatar
__philippe
Posts: 687
Joined: Wed Jun 26, 2013 2:09 am

Re: Applications that paste the date?

#14 Post by __philippe »

As a side note, quite a few of our old standby text editors / notepads do include a "current date-time stamp" paste function, ferinstance:

User avatar
webfork
Posts: 10818
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Re: Applications that paste the date?

#15 Post by webfork »

__philippe wrote:... quite a few of our old standby text editors / notepads do include a "current date-time stamp" paste function
Also useful, thanks for that. This is a fine thread we've put together :)

Post Reply