Project Thaidate
Status : - alpha
Installation
pip install thaidate
Usage
from thaidate import thaidate
from datetime import date
'''
thaidate(date(ปี, เดือน, วัน), True/False)
ex1:
ใช้เมื่อปี คือ พ.ศ. เช่น วันที่ 1 เดือนกุมภาพันธ์ ปี พ.ศ. 5
x = thaidate(date(5, 2, 1), True)
ex2:
ใช้เมื่อปี คือ ค.ศ. เช่น วันที่ 1 เดือนกุมภาพันธ์ ปี ค.ศ. 5
x = thaidate(date(5, 2, 1), False)
หรือ
x = thaidate(date(5, 2, 1))
ex3:
สำหรับแสดงวันที่ปัจจุบัน
x = thaidate()
'''
x = thaidate()
print(x.day) # x.day แสดงวันที่ เช่น วันที่ 1
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.date) # x.date แสดงวันที่ เดือน ปีพุทธศักราช เช่น 5 พฤศจิกายน 2536
print(x.short_date) # x.date แสดงวันที่ เดือน ปีพุทธศักราช เช่น 5 พ.ย. 2536
print(x.full_date) # x.full_date แสดงวัน เดือน ปี ในรูปแบบเต็ม
วัน.......ที่ ..... เดือน...... ปีพุทธศักราช ......
print(x.rattanakosin_era) # x.rattanakosin_era แสดงปี ร.ศ.
#####################################################################
y = thaidatetime() # ใช้คำสั่งนี้ สำหรับการแสดงวันเดือนปี ชั่วโมงนาทีวินาที
print(y.hour) # แสดงชั่วโมง
print(y.minute) # แสดงนาที
print(y.fulltime) # แสดงเวลา ในรูปแบบ 'เวลา ... นาฬิกา ... นาที ... วินาที'
print(y.datetime) # แสดงวันและเวลา ในรูปแบบ '5 พฤศจิกายน 2536 เวลา ... นาฬิกา ... นาที ... วินาที'
print(y.fulldatetime) # แสดงวันและเวลา ในรูปแบบ 'วัน.......ที่ ..... เดือน...... ปีพุทธศักราช ...... เวลา ... นาฬิกา ... นาที ... วินาที'
print(y.short_datetime) # แสดงวันและเวลา ในรูปแบบ 'วันที่ เดือน(ตัวย่อ) ปี เวลา ... นาฬิกา ... นาที ... วินาที'
Changelog
0.3.0
- แก้ไข bug ของ class thaidatetime()
0.2.5
- เพิ่มประสิทธิภาพการใช้แรม
0.2.2
- เพิ่ม การแสดงวันและเวลา โดยใช้คำสั่ง x = thaidatetime() [ถ้าหากต้องการแสดงแค่รูปแบบวัน ไม่รวมเวลา ให้ใช้คำสั่ง x = thaidate() ตามเดิม]
0.1.5
- แก้ไข bug แสดงผลไม่ถูกต้อง
ตั้งแต่เวอร์ชัน 0.1.0 ลงไป มีบัคการแสดงผลไม่ถูกต้อง ควรใช้ เวอร์ชัน 0.1.5 ขึ้นไป
0.1.0
- เปลี่ยนวิธีการแสดงผลวัน วันที่ เดือน ปี ในรูปแบบเต็ม จากเดิมต้องเรียกในรูปแบบเมธอด [x.full_date()] เป็น [x.full_date] ได้เลย
- เพิ่มแอททริบิวต์สำหรับแสดงวันที่ เดือน ปี
[x.date] => [x.day] [x.full_month] [x.year]
[x.short_date] => [x.day] [x.short_month] [x.year]
0.0.1b
- เพิ่มแอททริบิวต์สำหรับแสดง วันในสัปดาห์ [x.weekday] วันที่ [x.day] เดือน [x.full_month] [x.short_month] ปี [x.year]
- เพิ่มแอททริบิวต์สำหรับปี ร.ศ. [x.rattanakosin_era]
- เพิ่มเมธอด สำหรับแสดงวัน วันที่ เดือน ปี ในรูปแบบเต็ม [x.full_date()]
[x.full_date()] => วัน [x.weekday] ที่ [x.day] เดือน [x.month] ปีพุทธศักราช [x.year]
Metadata
Release files for thaidate 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| thaidate-0.4.0.tar.gz | 6.1 kB | Without provenance | Details for thaidate-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| thaidate-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for thaidate-0.4.0-py3-none-any.whl |
Total release size: 10.6 kB
Release files / thaidate-0.4.0.tar.gz
| Download URL | thaidate-0.4.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2a46830e471bf24469580de327004373a2cb608b336c6011b2323faec56c03d
|
|
BLAKE2b-256 checksum How to use checksums |
a8be162d9e05f6631e1cd5b13fc8a84f23b84b1972b21fe3b67c765515e7cfcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / thaidate-0.4.0-py3-none-any.whl
| Download URL | thaidate-0.4.0-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
316a7e097a683e9f5af1c6f007e73230eba0f4e42128c58665a9daf2b94fe739
|
|
BLAKE2b-256 checksum How to use checksums |
a15520d52819a85655b2bee8fc10762d84d6de54e842a8100c234b886f401b7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for thaidate 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.