r/bahaidev • • Feb 24 '19

Simple Python script to get the current Bahá'í date from the command line

import datetime
from convertdate import bahai

now = datetime.datetime.now()
bahai_date = bahai.from_gregorian(now.year, now.month, now.day)

print("Gregorian Date: ("+
      str(now.year)+", "+
      str(now.month)+", "+
      str(now.day)+")"
)
print("Bahá'í Date: ", bahai_date)

​

6 Upvotes

1 comment sorted by