In [17]: now.strftime(%a),now.strftime(%w)
Out[17]: ('Mon', '1')

Directive   Meaning
%a Weekday name.
%A Full weekday name.
%b Abbreviated month name.
%B Full month name.
%c Appropriate date and time representation.
%d Day of the month as a decimal number [01,31].
%H Hour (24-hour clock) as a decimal number [00,23].
%I Hour (12-hour clock) as a decimal number [01,12].
%j Day of the year as a decimal number [001,366].
%m Month as a decimal number [01,12].
%M Minute as a decimal number [00,59].
%p Equivalent of either AM or PM.
%S Second as a decimal number [00,61].
%U Week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0.
%w Weekday as a decimal number [0(Sunday),6].
%W Week number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday are considered to be in week 0.
%x Appropriate date representation.
%X Apropriate time representation.
%y Year without century as a decimal number [00,99].
%Y Year with century as a decimal number.
%Z Time zone name (no characters if no time zone exists).
%% A literal '%' character.

python 获取星期几的更多相关文章

  1. python获取命令行变量

    python获取命令行参数的方法是,开头使用import sys, 后面用sys.argv[0]表示文件名,sys.argv[1],sys.argv[2]...表示后续命令行参数. 注意,sys.ar ...

  2. 根据日期字符串获取星期几,日期获取星期,时间获取星期,js获取星期

    根据日期字符串获取星期几,日期获取星期,时间获取星期,js获取星期 >>>>>>>>>>>>>>>>&g ...

  3. SQL Server获取星期几

    上一周在解决一个Bug的时候,需要在SQL Server获取星期几的需求,在网上搜索了下,发现一篇好的文章,特转载下! 今天是星期几,例子 1: 1 SET LANGUAGE N'English' - ...

  4. python获取命令行参数的方法(汇总)

    介绍python获取命令行参数的方法:getopt模和argparse模块. python版本:2.7 一.getopt模块 主要用到了模块中的函数: options, args = getopt.g ...

  5. Python 获取秒级时间戳与毫秒级时间戳

    原文:Python获取秒级时间戳与毫秒级时间戳 1.获取秒级时间戳与毫秒级时间戳 import time import datetime t = time.time() print (t) #原始时间 ...

  6. python获取命令行参数

    python获取命令行参数 主要是通过sys的argv列表来获取命令行内容,命令行的参数以空格分隔放到argv列表中. import sys if __name__ == "__main__ ...

  7. 【Python】Python获取命令行參数

    有时候须要用同一个Python程序在不同的时间来处理不同的文件,此时假设老是要到Python程序中去改动输入.输出文件名称.就太麻烦了. 而通过Python获取命令行參数就方便多了.以下是我写得一个小 ...

  8. [py]python的time和datetime模块获取星期几

    import time import datetime #今天星期几 today=int(time.strftime("%w")) print today #某个日期星期几 any ...

  9. 【Python学习 】Python获取命令行参数的方法

    背景 最近编写一个python程序的时候,需要去获取python命令行的参数,因此这里记录下如何获取命令行参数的方法. 一.sys 模块 在 Python 中,sys 模块是一个非常常用且十分重要的模 ...

随机推荐

  1. C#的类,构造函数以及Array阵列的数据填充与绑定

    今天学习,如标题. 创建一个类,字段属性构造函数: Source code: using System; using System.Collections.Generic; using System. ...

  2. for循环的执行顺序

    一边回顾基础一边记录记录做个整理,这篇关于for循环的执行顺序: for(表达式1;表达式2;表达式3) {循环体} 第一步,先对表达式1赋初值; 第二步,判别表达式2是否满足给定条件,若其值为真,满 ...

  3. Asp.net Mvc模块化开发系列(目录)

    模块化开发是非常重要的,模块化开发是个系统性问题,为此我觉得有必须要写一个系列的文章才能基本说的清楚 那又为什么要写一个目录呢? 其一.是对我昨天承诺写一个系列新的文章的回应 其二.是先写出一个大纲, ...

  4. C#操作XML文件

    1.创建.读取XML文件 using System; using System.Collections.Generic; using System.Linq; using System.Text; u ...

  5. 说说这篇「我为什么从python转向go

    作者 CMGS2015.05.17 15:47* 写了7891字,被143人关注,获得了97个喜欢 说说这篇「我为什么从python转向go」 字数3748 阅读24227 评论21 喜欢81 恩看了 ...

  6. 使用JPA储存Text类型的时候 出现乱码的问题

    以前遇到这类问题第一个反应就是觉得客户端和服务端的编码不一样导致的.所以一开始也是那么认为的.以为我们项目使用的是pgsql,默认的就是utf-8,然后我们使用了字符也是utf-8,并且还有一个问题就 ...

  7. Java基础理论知识

    package domain; public class Person { private String name; private int age; private char gender; pub ...

  8. EasyUI-扩大在DataGrid显示次网格的行

    一.下载并引用:datagrid-detailview.js脚本文件 二.添加UrlInfo控制器,添加Index页面代码如下: @{ Layout = null; } <!DOCTYPE ht ...

  9. GC之详解CMS收集过程和日志分析

    2016-08-23   关于GC的算法和垃圾收集器的种类就暂且不说了,网上有大把的资料供参考 话题引入 让我们先简单的看下整个堆年轻代和年老代的垃圾收集器组合(以下配合java8完美支持,其他版本可 ...

  10. PHP 导出Excel 文档

    下面是总结的几个使用方法 include 'PHPExcel.php'; include 'PHPExcel/Writer/Excel2007.php'; //或者include 'PHPExcel/ ...