Skip to main content

cns工具包

Project description

cns

cns常用的工具包, 内置大量常用工具, 正在不断增加中......

安装方法

pip install cns

使用方法

import cns

if __name__ == "__main__":

    dfx  = cns.DateTimeX()  # 可初始化 "2023-05-28 23:23:51"

    print("初始时间:", dfx)

    print("昨天的本月区间:", dfx.get("{[年-月-初||复位-1日]}~{[年-月-日]}"))

    print("昨天的去年本月区间:", dfx.get("{[年-月-初||复位-1日-1年]}~{[年-月-末]}"))

    print("昨天的上月区间:", dfx.get("{[年-月-初||复位-1日-1月]}~{[年-月-末]}"))

    print("昨天的近35天区间:", dfx.get("{[年-月-日||复位-35日]}~{[年-月-日||复位-1日]}"))

    print("前35天的日期:", dfx.get("{[年-月-日||复位-35日]}"))

    print("昨天的月1号:", dfx.get("{[年-月-初||复位-1日]}"))

    print("昨天的本月:", dfx.get("{[年-月||复位-1日]}"))


'''
# 说明:
1、分隔符“||” 左侧是获取的时间格式,右侧是时间计算的指令;
2、左左侧的字符串中通包含年、月、日、时、分、秒、初、末,用来获取时间和格式,其中“初”是获数字1,“末”最后一天的日期;
3、右侧是时间计算的指令支持年、月、日、时、分、秒、复位,用来对当前的时间进行加和减的计算,其中“复位”代表恢复到初始时间;

目前支持WINDOWS下 Python 3.6 和 3.10
联系作者:6566666@qq.com
'''

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

cns-2.3.1-py3-none-any.whl (862.2 kB view details)

Uploaded Python 3

File details

Details for the file cns-2.3.1-py3-none-any.whl.

File metadata

  • Download URL: cns-2.3.1-py3-none-any.whl
  • Upload date:
  • Size: 862.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for cns-2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 538be0de24db13b69f8b3a813211a51d7765b59c9eec468fdb4aeba84454a76e
MD5 b9241f2adfc0b14c994aef5db130b1f0
BLAKE2b-256 2214a906d1d633e7a69e5f2848372404964c0c8d39bcd90394cfda645de31b90

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page