Codebase list libhdate / 4077d0cd-b45a-4579-a8e9-a2b21ff82dea/upstream examples / bindings / hdate_python.py
4077d0cd-b45a-4579-a8e9-a2b21ff82dea/upstream

Tree @4077d0cd-b45a-4579-a8e9-a2b21ff82dea/upstream (Download .tar.gz)

hdate_python.py @4077d0cd-b45a-4579-a8e9-a2b21ff82dea/upstreamraw · history · blame

#! /usr/bin/python

# hdate_python.py
# example file for libhdate.
#

#
# run: python hdate_python.py
#

#
#  Copyright (C) 2008  Yaacov Zamir <kzamir@walla.co.il>
#  
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# Use locale to support hdate localization
import locale
locale.setlocale(locale.LC_ALL,'')
        
# Import the hdate library
from hdate import *;

# Create a new Hdate object
h = Hdate ();

# Print gregorian date
print "Today is:"
print str (h.get_gday ()) + "," + str (h.get_gmonth ()) + "," + str (h.get_gyear ())

# Print hebrew date: 0 - long format
print h.get_format_date (0);