Skip to main content

python-thaidate

Project description

Project Thaidate

Status : 0.0.1b

Installation

    pip install thaidate

Usage

from thaidate import thaidate

'''
    thaidate('วัน เดือน ปี', True/False)
    ex1: 
        ใช้เมื่อปี คือ พ.ศ.
        x = thaidate('1 2 5', True) 

    ex2: 
        ใช้เมื่อปี คือ ค.ศ.
        x = thaidate('1 2 5', False) 
        หรือ
        x = thaidate('1 2 5')

    ex3:
        สำหรับแสดงวันที่ปัจจุบัน
        x = thaidate()   

'''

x = thaidate()
print(x.day)                # x.day แสดงวันที่
print(x.full_month)         # x.full_month แสดงเดือนแบบเต็ม
print(x.short_month)        # x.short_month แสดงเดือนแบบย่อ
print(x.year)               # x.year แสดงปี พ.ศ.
print(x.weekday)            # x.weekday แสดงวันในสัปดาห์

print(x.full_date())        # x.full_date()  แสดงวัน เดือน ปี ในรูปแบบเต็ม 
วัน.......ที่ ..... เดือน...... ปีพุทธศักราช ...... 

print(x.rattanakosin_era)   # x.rattanakosin_era  แสดงปี ร.ศ.

Chengelog

0.0.1b

  • เพิ่มแอททริบิวต์สำหรับแสดง วันในสัปดาห์ วันที่ เดือน ปี
  • เพิ่มเมธอด สำหรับแสดงวัน เดือน ปี ในรูปแบบเต็ม

Project details


Download files

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

Source Distribution

thaidate-0.0.1b1.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

thaidate-0.0.1b1-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

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