How can I make the system return a different Date Format? [solved]

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
User avatar
AZgl1500
Level 9
Level 9
Posts: 2861
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

How can I make the system return a different Date Format? [solved]

Post by AZgl1500 » Thu Sep 20, 2018 6:14 pm

I use a shortcut for date a lot, as I date all of my personal notes, letters, whatever....

and it keeps returning the 'year' at the end of the string, which is aggravating for me.
Thu Sep 20 17:10:02 CDT 2018 is how it is being returned to my documents, and the forum also.

My preference would simply be 9/20/2018 as the time of day carries no significance at all a year from now, or even tomorrow. Such a change would probably effect the Command Line, er uh, Panel time display ....
so can I have two methods to show up?

1 for my shortcut for documents,
2 for the Panel to leave it alone as is?
Last edited by AZgl1500 on Fri Sep 21, 2018 1:49 am, edited 1 time in total.

gm10
Level 13
Level 13
Posts: 4581
Joined: Thu Jun 21, 2018 5:11 pm

Re: How can I make the system return a different Date Format?

Post by gm10 » Thu Sep 20, 2018 6:21 pm

AZgl1500 wrote:
Thu Sep 20, 2018 6:14 pm
My preference would simply be 9/20/2018
For example:

Code: Select all

echo $(date +%d/%m/%Y)
I trust you can amend your shortcut based on that.

User avatar
CtrlAltDel
Level 4
Level 4
Posts: 488
Joined: Sun Jun 27, 2010 7:01 pm
Location: Birmingham, AL., USA

Re: How can I make the system return a different Date Format?

Post by CtrlAltDel » Fri Sep 21, 2018 12:27 am

AZgl1500 wrote:
Thu Sep 20, 2018 6:14 pm
I use a shortcut for date a lot, as I date all of my personal notes, letters, whatever....

and it keeps returning the 'year' at the end of the string, which is aggravating for me.
Thu Sep 20 17:10:02 CDT 2018 is how it is being returned to my documents, and the forum also.

My preference would simply be 9/20/2018 as the time of day carries no significance at all a year from now, or even tomorrow. Such a change would probably effect the Command Line, er uh, Panel time display ....
so can I have two methods to show up?

1 for my shortcut for documents,
2 for the Panel to leave it alone as is?
Sat 10:38 PM %a %l:%M %p

Nov. 16, 10:17:00 PM %b %e, %l:%M %S %p

Sunday, Jul 27 %A, %b %d

07/27/2014 %m/%d/%Y

07-27-14 02:59 %m-%e-%y %H:%M

Jul 27, 2:59 AM %b %e, %l:%M %p

July 2014 %B %Y

Jul 27, 2014 %b %d, %Y

Sun, 27 Jul 2014 02:59:00 +0000 %a, %e %b %Y %H:%M:%S %z

2014-07-27T 2:59:00+0000 %Y-%m-%dT%l:%M:%S%z%I

02:59:00 AM %I:%M:%S %p

02:59:00% H:%M:%S

27 Jul 2014 02:59:00AM %e %b %Y %H:%M:%S%p

27.07.14 %d.%m.%y

Sunday, 27 Jul 2014 2:59 AM %A, %d %b %Y %l:%M %p
Intel i7-4790 Processor
Nvidia GeForce GT 720
8 GB Memory - 2x1 TB HD's
Mint 19 Cinnamon 64bit

User avatar
AZgl1500
Level 9
Level 9
Posts: 2861
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: How can I make the system return a different Date Format?

Post by AZgl1500 » Fri Sep 21, 2018 1:48 am

thank you, both.

I am sure that is documented somewhere, I just hadn't found it.

and yes, the shortcut can be modified.

gm10
Level 13
Level 13
Posts: 4581
Joined: Thu Jun 21, 2018 5:11 pm

Re: How can I make the system return a different Date Format?

Post by gm10 » Fri Sep 21, 2018 2:14 am

AZgl1500 wrote:
Fri Sep 21, 2018 1:48 am
I am sure that is documented somewhere, I just hadn't found it.
If you really didn't know: Nearly every command in Linux has a manual, accessed like this:

Code: Select all

man date

User avatar
AZgl1500
Level 9
Level 9
Posts: 2861
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: How can I make the system return a different Date Format? [solved]

Post by AZgl1500 » Fri Sep 21, 2018 6:49 am

Well,

Here is the "Rest of the Story"
you guys got me headed in the right direction, sort of.....

I was trying to use AutoKey to output the "date" only, but none of the Terminal commands will do the job because AutoKey uses Python Script

oops!
so, ole johnnie boy has ta larn python

it took a lot of reading and none of the examples that my searches returned gave me the exact answer.
but, reading what they did, and playing around with a lot of different scripts, which mostly gave errors,
I finally stumbled across what I wanted.

========================================
from time import strftime
showdate = strftime("%m/%d/%Y")
keyboard.send_keys(showdate)

========================================

That Python script in AutoKey will export the date in this format 09/21/2018
into any text document that I am typing into, be it 'xed', or 'this forum'

I am using date as the Keyword Phrase in UpperCase to be replaced with 09/21/2018
the actual spelling of the word 'date' shows up too much in normal speech to use it as the 'keyword'...

so, for what it is worth, and if anyone uses AutoKey besides me,
the script to make it output the date only, is now working for me.

Many thanks to all of the helpful gurus who guide us into the right direction...

User avatar
AZgl1500
Level 9
Level 9
Posts: 2861
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: How can I make the system return a different Date Format?

Post by AZgl1500 » Fri Sep 21, 2018 6:52 am

gm10 wrote:
Fri Sep 21, 2018 2:14 am
AZgl1500 wrote:
Fri Sep 21, 2018 1:48 am
I am sure that is documented somewhere, I just hadn't found it.
If you really didn't know: Nearly every command in Linux has a manual, accessed like this:

Code: Select all

man date
I knew that, but for some reason, did not think to use Terminal to research it... :roll:
google of course, also provided a lot of help tonight.

User avatar
phd21
Level 17
Level 17
Posts: 7482
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: How can I make the system return a different Date Format? [solved]

Post by phd21 » Fri Sep 21, 2018 11:06 am

Hi AZgl1500,

I just read your post and the good replies to it. Here are my thoughts on this as well.

It would have helped before if you mentioned that you were using the great and powerful and extremely useful "autokey" application for this. Tip: After entering in some new autokey phrases, you may have to save autokey and restart it for them to work properly.

Previous posts:
Inserting Date & Time into any text file - Linux Mint Forums
viewtopic.php?f=90&t=238132&hilit=autokey+date

Your previous post
Need the "degree symbol" is now [Solved] - Linux Mint Forums
viewtopic.php?f=90&t=265878&hilit=autokey+date

...
autokey_date_script1.jpg
Autokey with date script
Phd21: Mint KDE 17.3 & 18.3, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram,256gb SDD, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

User avatar
AZgl1500
Level 9
Level 9
Posts: 2861
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: How can I make the system return a different Date Format? [solved]

Post by AZgl1500 » Fri Sep 21, 2018 1:38 pm

yes,
had I mentioned AutoKey which I am using for several shortcuts, it would have made the answers provided more succinct.

I changed the Calendar display in the Panel to 9/21/2018, Fri 10:13 AM
which just meets with my sensibilities a bit better.

and now that AutoKey is returning the "correct date" format for my kybd text stuff, I am a lot happier now.

it is these little tweaks that we do like that, that make our DEs more comfortable to us.
and at the same time, makes trying out a different DE an unpleasant thought if wanting to make it a permanent Daily Driver.

argh!, all of those hours of trying to make Cinnamon just like I want it....
right now, it so darn near perfect, that the thought of not using it hurts.

One thing is for sure though....... "Real soon now", I am going to start messing with Python...
the more I read about Python, the more encouraged I am at trying to make some sense out of it for my little home projects.

I will never, ever, be good enough to claim to be a programmer.....
the memory cells that were destroyed when the semi truck merged my and my motorcycle into the center median wall.

Post Reply

Return to “Software & Applications”