-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sujit Maharjan
authored and
Sujit Maharjan
committed
Jul 12, 2020
1 parent
ecc29c1
commit 2ad6815
Showing
4 changed files
with
61 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from .datebs import DateBS | ||
import argparse | ||
import datetime | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(prog="python -m datebs",description='Convert date from BS to AD and vice-versa') | ||
parser.add_argument('calendar',type=str, help="calendar system in which date is to be displayed [AD|BS]") | ||
parser.add_argument('--date',type=str, help="date opporsite to the calendar system") | ||
args = parser.parse_args() | ||
if (args.calendar == "BS"): | ||
if args.date: | ||
dateBS = DateBS.from_AD(datetime.datetime.strptime(args.date, "%Y-%m-%d")) | ||
else: | ||
dateBS = DateBS.from_AD(datetime.datetime.now()) | ||
print(dateBS) | ||
else: | ||
if args.date: | ||
dateBS = DateBS.from_string(args.date) | ||
print(dateBS.to_AD()) | ||
else: | ||
print(datetime.datetime.now()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters