All Projects â†’ dxillar â†’ nepali-datetime

dxillar / nepali-datetime

Licence: MIT License
Python's core datetime inspired nepali datetime (BS date & NPT) package 🇳🇵

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to nepali-datetime

Time
Building a better date/time library for Swift
Stars: ✭ 1,983 (+5408.33%)
Mutual labels:  time, datetime, date, calendar, timezone
Date
A date and time library based on the C++11/14/17 <chrono> header
Stars: ✭ 2,389 (+6536.11%)
Mutual labels:  time, datetime, date, calendar, timezone
nepcal
Robust, highly tested, cross-platform library and command-line utilities for Nepali dates
Stars: ✭ 37 (+2.78%)
Mutual labels:  date, nepal, nepali, nepali-date
Laydate
layDate(日期与时间组件) 是 layui 独立维护的三大组件之一
Stars: ✭ 1,066 (+2861.11%)
Mutual labels:  time, datetime, date, calendar
Calendar
📅 PHP Date & Time library that solves common problems in object oriented, immutable way.
Stars: ✭ 113 (+213.89%)
Mutual labels:  time, datetime, date, calendar
React Datetime Picker
A datetime picker for your React app.
Stars: ✭ 294 (+716.67%)
Mutual labels:  time, datetime, date, calendar
Period
PHP's time range API
Stars: ✭ 616 (+1611.11%)
Mutual labels:  time, datetime, date, calendar
nepali date picker
Material Style Date Picker with Bikram Sambat(Nepali) Calendar Support. Supports both Android and ios.
Stars: ✭ 30 (-16.67%)
Mutual labels:  calendar, nepal, nepali, bikram-sambat
Angular Moment Picker
Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
Stars: ✭ 536 (+1388.89%)
Mutual labels:  time, datetime, date, calendar
Delorean
Delorean: Time Travel Made Easy
Stars: ✭ 1,793 (+4880.56%)
Mutual labels:  time, datetime, date, timezone
hs-hourglass
efficient and simpler time API for haskell
Stars: ✭ 43 (+19.44%)
Mutual labels:  time, datetime, date, timezone
Luatz
Time, Date and Timezone library for lua
Stars: ✭ 92 (+155.56%)
Mutual labels:  time, datetime, date, timezone
Tail.datetime
A lightweight, translat- and configurable Open Source DateTime Picker, written in pure vanilla JavaScript!
Stars: ✭ 139 (+286.11%)
Mutual labels:  time, datetime, date, calendar
Dpicker
A framework-agnostic minimal date picker
Stars: ✭ 187 (+419.44%)
Mutual labels:  time, datetime, date, calendar
shamsi date
A Flutter and Dart package for using Jalali (Shamsi, Solar, Persian or Jalaali) calendar. You can convert, format and manipulate Jalali and Gregorian (Miladi) date and times.
Stars: ✭ 59 (+63.89%)
Mutual labels:  time, datetime, date, calendar
temps-lite
A smart, good-looking little app which tries to speak your language the way you are used to.
Stars: ✭ 40 (+11.11%)
Mutual labels:  time, date, timezone
date-extractor
Extract dates from text
Stars: ✭ 58 (+61.11%)
Mutual labels:  time, datetime, date
time machine
A date and time API for Dart
Stars: ✭ 120 (+233.33%)
Mutual labels:  time, date, timezone
lit-date
Light-weight, faster datetime formatter for modern browsers.
Stars: ✭ 33 (-8.33%)
Mutual labels:  time, datetime, date
TimesDates.jl
Nanosecond resolution for Time and Date, TimeZones
Stars: ✭ 28 (-22.22%)
Mutual labels:  time, date, timezone

Nepali Datetime (Bikram Sambat Date & Nepal Time)

The package inspired from Python's core datetime package that operates on top of Bikram Sambat (B.S) Date & Nepal Time (NPT) +05:45.

Supports: Python 3.5+

Basic Usage

# importing
>>> import datetime
>>> import nepali_datetime

# today's date
>>> datetime.date.today()
>>> nepali_datetime.date.today()

# now datetime
>>> datetime.datetime.now()
>>> nepali_datetime.datetime.now()

# creating date object
>>> datetime.date(2020, 9, 4)
>>> nepali_datetime.date(2077, 5, 19)

# creating datetime object
>>> datetime.datetime(2020, 9, 4, 8, 26, 10, 123456)
>>> nepali_datetime.datetime(2077, 5, 19, 8, 26, 10, 123456)

# date/datetime formatting
>>> nepali_datetime.datetime(2077, 5, 19, 8, 26, 10, 123456).strftime("%d %B %Y")
# 19 Bhadau 2077

# datetime parsed from string (strptime)
>>> nepali_datetime.datetime.strptime('2077-09-12', '%Y-%m-%d')
# nepali_datetime.datetime(2077, 9, 12, 0, 0)

# date/datetime formatting with Nepali unicode support
>>> nepali_datetime.date(1977, 10, 25).strftime('%K-%n-%D (%k %N %G)')
# १९७७-१०-२५ (७७ माघ आइतबार)

# datetime.timedelta addition/subtraction
>>> nepali_datetime.date(1990, 5, 10) + datetime.timedelta(days=350)
# nepali_datetime.date(1991, 4, 26)
>>> nepali_datetime.datetime(1990, 5, 10, 5, 10, 20) + datetime.timedelta(hours=3, minutes=15)
# nepali_datetime.date(1990, 5, 10, 8, 25, 20)

# Bikram Sambat monthly calendar
>>> nepali_datetime.date(2078, 1, 1).calendar()

          Baishakh 2078
Sun  Mon  Tue  Wed  Thu  Fri  Sat
                1    2    3    4
5     6    7    8    9   10   11
12   13   14   15   16   17   18
19   20   21   22   23   24   25
26   27   28   29   30   31

Installation

$ pip install nepali-datetime

Documentation

Complete documentations is here.

Contribution

Any contributions are most welcome. Do check the guidelines in CONTRIBUTING.md.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].