What's meaning of the “p” in the name datetime.datetime.strptime()? [duplicate]
This question already has an answer here:
What does the “p” in strptime stand for?
4 answers
I'm learning the python's datetime module, and found two useful functions:datetime.strptime()
and datetime.strftime()
.
I know that the functions meaning, datetime.strftime()
could convert a time object to a specified format string, I could understand the strftime
as "string from time", the "f" means "from". But what's the meaning of the "p" in strptime()
? I understand it's a function as "convert a string to a time object", so it should be strttime()
instead of strptime()
.
Who else also feel confused on this function name?
Thanks in advance no matter you could answer this question or share the same confusion with me.
python datetime
marked as duplicate by coldspeed
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 13 '18 at 9:37
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
What does the “p” in strptime stand for?
4 answers
I'm learning the python's datetime module, and found two useful functions:datetime.strptime()
and datetime.strftime()
.
I know that the functions meaning, datetime.strftime()
could convert a time object to a specified format string, I could understand the strftime
as "string from time", the "f" means "from". But what's the meaning of the "p" in strptime()
? I understand it's a function as "convert a string to a time object", so it should be strttime()
instead of strptime()
.
Who else also feel confused on this function name?
Thanks in advance no matter you could answer this question or share the same confusion with me.
python datetime
marked as duplicate by coldspeed
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 13 '18 at 9:37
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Thep
stands for "parse". Practically, it parses thestring
into adatetime
object.
– Tiberiu Zulean
Nov 13 '18 at 9:43
The "f" in strftime actually comes from "format".
– chthonicdaemon
Nov 13 '18 at 9:56
This question is really asked by others. And let me list the possible answers here: 1. Pointer(time object pointer), 2. Parser(String's parser to a time object), 3. Posix(return a posix time object), 4. Put( put a string represented time to a time object)
– Clock ZHONG
Nov 14 '18 at 1:14
add a comment |
This question already has an answer here:
What does the “p” in strptime stand for?
4 answers
I'm learning the python's datetime module, and found two useful functions:datetime.strptime()
and datetime.strftime()
.
I know that the functions meaning, datetime.strftime()
could convert a time object to a specified format string, I could understand the strftime
as "string from time", the "f" means "from". But what's the meaning of the "p" in strptime()
? I understand it's a function as "convert a string to a time object", so it should be strttime()
instead of strptime()
.
Who else also feel confused on this function name?
Thanks in advance no matter you could answer this question or share the same confusion with me.
python datetime
This question already has an answer here:
What does the “p” in strptime stand for?
4 answers
I'm learning the python's datetime module, and found two useful functions:datetime.strptime()
and datetime.strftime()
.
I know that the functions meaning, datetime.strftime()
could convert a time object to a specified format string, I could understand the strftime
as "string from time", the "f" means "from". But what's the meaning of the "p" in strptime()
? I understand it's a function as "convert a string to a time object", so it should be strttime()
instead of strptime()
.
Who else also feel confused on this function name?
Thanks in advance no matter you could answer this question or share the same confusion with me.
This question already has an answer here:
What does the “p” in strptime stand for?
4 answers
python datetime
python datetime
edited Nov 13 '18 at 9:57
martineau
66.2k989178
66.2k989178
asked Nov 13 '18 at 9:35
Clock ZHONGClock ZHONG
386313
386313
marked as duplicate by coldspeed
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 13 '18 at 9:37
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by coldspeed
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 13 '18 at 9:37
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Thep
stands for "parse". Practically, it parses thestring
into adatetime
object.
– Tiberiu Zulean
Nov 13 '18 at 9:43
The "f" in strftime actually comes from "format".
– chthonicdaemon
Nov 13 '18 at 9:56
This question is really asked by others. And let me list the possible answers here: 1. Pointer(time object pointer), 2. Parser(String's parser to a time object), 3. Posix(return a posix time object), 4. Put( put a string represented time to a time object)
– Clock ZHONG
Nov 14 '18 at 1:14
add a comment |
Thep
stands for "parse". Practically, it parses thestring
into adatetime
object.
– Tiberiu Zulean
Nov 13 '18 at 9:43
The "f" in strftime actually comes from "format".
– chthonicdaemon
Nov 13 '18 at 9:56
This question is really asked by others. And let me list the possible answers here: 1. Pointer(time object pointer), 2. Parser(String's parser to a time object), 3. Posix(return a posix time object), 4. Put( put a string represented time to a time object)
– Clock ZHONG
Nov 14 '18 at 1:14
The
p
stands for "parse". Practically, it parses the string
into a datetime
object.– Tiberiu Zulean
Nov 13 '18 at 9:43
The
p
stands for "parse". Practically, it parses the string
into a datetime
object.– Tiberiu Zulean
Nov 13 '18 at 9:43
The "f" in strftime actually comes from "format".
– chthonicdaemon
Nov 13 '18 at 9:56
The "f" in strftime actually comes from "format".
– chthonicdaemon
Nov 13 '18 at 9:56
This question is really asked by others. And let me list the possible answers here: 1. Pointer(time object pointer), 2. Parser(String's parser to a time object), 3. Posix(return a posix time object), 4. Put( put a string represented time to a time object)
– Clock ZHONG
Nov 14 '18 at 1:14
This question is really asked by others. And let me list the possible answers here: 1. Pointer(time object pointer), 2. Parser(String's parser to a time object), 3. Posix(return a posix time object), 4. Put( put a string represented time to a time object)
– Clock ZHONG
Nov 14 '18 at 1:14
add a comment |
1 Answer
1
active
oldest
votes
These are the developer doc string says. I guess p
stands for parsing datetime
from a string
type.
In [2]: datetime.datetime.strptime??
Docstring: string, format -> new datetime parsed from a string (like time.strptime()).
Type: builtin_function_or_method
In [3]: datetime.datetime.strftime??
Docstring: format -> strftime() style string.
Type: method_descriptor
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
These are the developer doc string says. I guess p
stands for parsing datetime
from a string
type.
In [2]: datetime.datetime.strptime??
Docstring: string, format -> new datetime parsed from a string (like time.strptime()).
Type: builtin_function_or_method
In [3]: datetime.datetime.strftime??
Docstring: format -> strftime() style string.
Type: method_descriptor
add a comment |
These are the developer doc string says. I guess p
stands for parsing datetime
from a string
type.
In [2]: datetime.datetime.strptime??
Docstring: string, format -> new datetime parsed from a string (like time.strptime()).
Type: builtin_function_or_method
In [3]: datetime.datetime.strftime??
Docstring: format -> strftime() style string.
Type: method_descriptor
add a comment |
These are the developer doc string says. I guess p
stands for parsing datetime
from a string
type.
In [2]: datetime.datetime.strptime??
Docstring: string, format -> new datetime parsed from a string (like time.strptime()).
Type: builtin_function_or_method
In [3]: datetime.datetime.strftime??
Docstring: format -> strftime() style string.
Type: method_descriptor
These are the developer doc string says. I guess p
stands for parsing datetime
from a string
type.
In [2]: datetime.datetime.strptime??
Docstring: string, format -> new datetime parsed from a string (like time.strptime()).
Type: builtin_function_or_method
In [3]: datetime.datetime.strftime??
Docstring: format -> strftime() style string.
Type: method_descriptor
edited Nov 13 '18 at 9:44
Tiberiu Zulean
14713
14713
answered Nov 13 '18 at 9:38
Rahul K PRahul K P
7,16122033
7,16122033
add a comment |
add a comment |
The
p
stands for "parse". Practically, it parses thestring
into adatetime
object.– Tiberiu Zulean
Nov 13 '18 at 9:43
The "f" in strftime actually comes from "format".
– chthonicdaemon
Nov 13 '18 at 9:56
This question is really asked by others. And let me list the possible answers here: 1. Pointer(time object pointer), 2. Parser(String's parser to a time object), 3. Posix(return a posix time object), 4. Put( put a string represented time to a time object)
– Clock ZHONG
Nov 14 '18 at 1:14