cal command alternatives

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#41 Post by MochiMoppel »

musher0 wrote:Not that it's important, but %H:%M:%S can be summarized as %R.
Not that it's important, but you probably meant %T

some1
Posts: 117
Joined: Thu 17 Jan 2013, 11:07

#42 Post by some1 »

MochiiMoppel wrote:
musher0 wrote: Not that it's important, but %H:%M:%S can be summarized as %R.
Not that it's important, but you probably meant %T
Not that it is important ,but to please the locals , you probably meant %X.

some1
Posts: 117
Joined: Thu 17 Jan 2013, 11:07

#43 Post by some1 »


User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#44 Post by MochiMoppel »

some1 wrote:Not that it is important ,but to please the locals , you probably meant %X.
That wouldn't be the same as %H:%M:%S , so I honestly,wholeheartedly,really,truly meant what I wrote: %T :wink:

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#45 Post by musher0 »

Seconds are useless in a general non scientific human context, hence %R. ;)
Plus date's seconds update calls upon the kernel 60 times a minute, which
can be a concern on old boxes.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
torm
Posts: 186
Joined: Sat 07 Mar 2015, 19:56

#46 Post by torm »

Modified a little the old pmonth_p program.
Also renamed it to tell the difference.

Summary.
In a way, sting ver.01 is not oriented at regular users,
while it could be useful for scripters - to avoid complicated
logic in GUI apps that should follow locale specific calendar
layout. Well, in GTK2 this may or not matter - as there is built-in and
almost fullfeatured widget for that purpose, other toolkits are not
that lucky in that respect.
Simplest use would be as input for Conky, GKrellm2, etc.

Features.
Automated locale support, week start day detection.
Abbreviated day labels with dual or single letter.
Numerical commandline arguments for current date marks,
and also for year and month selection - from 1800 to 9999.
Current date marks can also be turned off or selected from
seven different built-in options.
Month numerical value with or without leading zero.
Some error checking on input to avoid segfaults, etc.

Build.
No special dependencies, regular
make
make install
Expected build size is around 10 KB stripped.

License.
Public Domain. Feel free to relicense as needed.

Development.
Some of the code is still hacky and untested.
Could be extended with more "invisible" date marks
to support different scripts or outputs, etc.
Open for suggestions and fixes.

And a big fat disclaimer:
Note that sting ver.01 is a commandline program,
so likely there will be nothing happening when you doubleclick
on it with the mouse :wink:
Uh, just in case..
Attachments
sting-01_calendar_C-source.tar.gz
sting calendar C-source version 01
(4.4 KiB) Downloaded 69 times

Post Reply