Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is there a strftime() format for day-of-the-week?

44 views
Skip to first unread message

Kenny McCormack

unread,
Feb 22, 2015, 9:17:23 AM2/22/15
to
If you do: strftime("%c",x)
the first 3 characters are the day of the week (as 3 letters of text),
e.g., "Mon". But what if you want just those 3 letters - not the whole %c
output?

I could not find a conversion for this? Am I missing something?

--
"The anti-regulation business ethos is based on the charmingly naive notion
that people will not do unspeakable things for money." - Dana Carpender

Quoted by Paul Ciszek (pciszek at panix dot com). But what I want to know
is why is this diet/low-carb food author doing making pithy political/economic
statements?

Nevertheless, the above quote is dead-on, because, the thing is - business
in one breath tells us they don't need to be regulated (which is to say:
that they can morally self-regulate), then in the next breath tells us that
corporations are amoral entities which have no obligations to anyone except
their officers and shareholders, then in the next breath they tell us they
don't need to be regulated (that they can morally self-regulate) ...

Ed Morton

unread,
Feb 22, 2015, 9:54:19 AM2/22/15
to
On 2/22/2015 8:17 AM, Kenny McCormack wrote:
> If you do: strftime("%c",x)
> the first 3 characters are the day of the week (as 3 letters of text),
> e.g., "Mon". But what if you want just those 3 letters - not the whole %c
> output?
>
> I could not find a conversion for this? Am I missing something?
>

Yes, %a:

$ awk 'BEGIN{print strftime("%a",systime())}'
Sun

Kenny McCormack

unread,
Feb 22, 2015, 9:59:00 AM2/22/15
to
In article <mccqhh$aif$1...@dont-email.me>,
OK, thanks.

Just missed it in the dox. Probably because it is at the top of the list.

--
Faced with the choice between changing one's mind and proving that there is
no need to do so, almost everyone gets busy on the proof.

- John Kenneth Galbraith -

Janis Papanagnou

unread,
Feb 22, 2015, 11:14:37 AM2/22/15
to
Am 22.02.2015 um 15:58 schrieb Kenny McCormack:
>> On 2/22/2015 8:17 AM, Kenny McCormack wrote:
>>> If you do: strftime("%c",x)
>>> the first 3 characters are the day of the week (as 3 letters of text),
>>> e.g., "Mon". But what if you want just those 3 letters - not the whole %c
>>> output?
>>>
>>> I could not find a conversion for this? Am I missing something?
>>>
[...]
>
> Just missed it in the dox. Probably because it is at the top of the list.

Some time ago I compiled a tabular list of the time format specifiers;
the column(s) of example output for each specifier certainly helps to
quickly find what one needs: http://volatile.gridbug.de/tifosp.html
(I guess the padding column and the informal use of '_' for blanks in
the examples is self explanatory.)

Janis

Kaz Kylheku

unread,
Feb 22, 2015, 6:50:35 PM2/22/15
to
On 2015-02-22, Kenny McCormack <gaz...@shell.xmission.com> wrote:
> Just missed it in the dox. Probably because it is at the top of the list.

Because, when the hell is anything that you're looking for at the top of the
list?

Skipping randomly into the list is actually a reasonable algorithm; over the
years you've still saved much more time than you wasted today. :)
0 new messages