Date and time

Source: Internet
Author: User
  1. Get Time

>>> Import time >>> ticks = time. time () >>> print (ticks) 1415277557.990928 >>> localtime = time. localtime (ticks) >>> print (localtime) time. struct_time (maid = 2014, tm_mon = 11, tm_mday = 6, tm_hour = 20, tm_min = 39, tm_sec = 17, tm_wday = 3, tm_yday = 310, tm_isdst = 0) >>> time. asctime (localtime) 'thu Nov 6 20:39:17 123'

Time. asctime (time. localtime (time. time ()))

2. Get calendar

>>> Import calendar >>> print (calendar. month (2007,1 )) january 2008Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 19 2021 22 23 24 25 26 2728 29 30 31

  






Date and time

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.