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

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
AZgl1800
Level 20
Level 20
Posts: 11183
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 AZgl1800 »

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 LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
gm10

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

Post by gm10 »

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
AZgl1800
Level 20
Level 20
Posts: 11183
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 AZgl1800 »

thank you, both.

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

and yes, the shortcut can be modified.
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
gm10

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

Post by gm10 »

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
AZgl1800
Level 20
Level 20
Posts: 11183
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 AZgl1800 »

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...
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
User avatar
AZgl1800
Level 20
Level 20
Posts: 11183
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 AZgl1800 »

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.
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
phd21
Level 20
Level 20
Posts: 10104
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 »

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
Phd21: Mint 20 Cinnamon & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 (7573, quad core i5-8250U ) 2 in 1 touch screen
User avatar
AZgl1800
Level 20
Level 20
Posts: 11183
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 AZgl1800 »

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.
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
Locked

Return to “Software & Applications”