Python Time asctime() Method

Python Time asctime() Method

The asctime() method turns a tuple or struct time representing a time provided by gmtime() or localtime() into a 24-character text of the type ‘Mon May 23 20:22:05 2022’.

Example of asctime() Method

Day Mon Date Hour:Min:Sec Year

For example:

Thu 05 22 09:50:43 2022

Syntax of asctime()

This is the syntax for asctime() method

Parameters

t is a nine-element tuple or struct_time that represents a time as returned by the gmtime() or localtime() functions.

Return Value

This function gives 24-character string of the form – ‘Mon May 23 20:22:05 2022’.

Code

The Output of the above example code is:

time.asctime(t): Mon May  9 22:37:07 2022 

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/courses/263135.html

(0)
上一篇 2022年5月30日 16:58
下一篇 2022年5月30日 16:58

相关推荐

发表回复

登录后才能评论