Home > Backend Development > Python Tutorial > Python example of how to get the day of the week a certain day is

Python example of how to get the day of the week a certain day is

高洛峰
Release: 2017-02-21 10:33:55
Original
2303 people have browsed it

The example in this article describes how Python gets the day of the week that a certain day is. Share it with everyone for your reference, the details are as follows:

Here we take the Spring Festival of 2017 (January 28) as an example:

import re;
import time;
import datetime;
if(__name__=="__main__"):
  #today=int(time.strftime("%w"));
  anyday=datetime.datetime(2017,1,28).strftime("%w");
  print anyday
Copy after login

The running effect diagram is as follows:

Python example of how to get the day of the week a certain day is

For more examples of Python methods to get the day of the week for a certain day, please pay attention to the PHP Chinese website for related articles!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template