Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of 'strf' in 'strftime'

Tags:

strftime

What does 'strf' in 'strftime' stand for? I've googled this question numerous times, but haven't found an answer. Knowing what the letters stood for would enable me to more easily remember the name of this function.

like image 809
Iswip Avatar asked Apr 27 '18 15:04

Iswip


2 Answers

From man 3 strftime:

STRFTIME(3)

NAME
       strftime - format date and time

So that's str -- as in, string, the data type that the function works with -- format.

The manpage specifically refers to strftime as it's defined in the C standard library. Many modern languages with functions named strftime have so named them by convention based on C (because as @EricLippert implied in a comment, no sane modern language would use this kind of naming convention).

For completeness, no part of the strptime(3) manpage explicitly says that the p stands for parse (or print, although strptime doesn't print anything in the first place), but it very likely stands for parse.

like image 182
0xdd Avatar answered Oct 26 '22 19:10

0xdd


strftime means string from time . we can format the time in different desirable ways.

This is the name reason only. For information about this method, Kindly click here Other link from Quora

I hope you understood.

like image 26
Anand Raja Avatar answered Oct 26 '22 19:10

Anand Raja