hdate:

This example displays the current date.
/*
compile: gcc -lm -lhdate -o hdate_c hdate_c.c
*/

#include < stdio.h> /* for printf */
#include < hdate.h> /* for hebrew date */

int
main()
{
  /* date will be stored in h */
  hdate_struct h; 
  
  /* copy the hebrew date struct of today 
  <day=0, month=0, year=0 > */
  hdate_set_gdate(&h, 0, 0, 0); 
  
  /* print gregorian date */
  printf ("Today is :\n");
  printf ("%d,%d,%d\n", hdate_get_gday (h), 
    hdate_get_gmonth (h), 
    hdate_get_gyear (h));
	
  /* print hebrew date: 0 - israely holidays, 
  0 - long format */
  printf ("%s\n", hdate_get_format_date (h, 0, 0));
  printf ("\n");
  
  /* unref the used memory */
  delete_hdate (h);
	
  return 0;
}
This line compiles the C example:
gcc -lm -lhdate hdate_c.c -o hdate_c
This line compiles the C++ example, using pkg-config (works with C too):
g++ `pkg-config --libs --cflags libhdate` hdate_cpp.cpp -o hdate_cpp
More code examples:

hcal/hdate package:

The hdate and hcal utilities are part of the binary backages. The hcal and hdate code is in the examples folder in libhdate code.

hdate-tray-icon:

The hdate system tray icon is a tray icon that show in it's tooltip the Hebrew date.

This tray icon requires python, pygtk (gtk python bindings) and libhdate python bindings.
To run this system tray use python (e.g. python hdate_systray.py from the command line).
The code is here:.
examples/hdate_systray.py

hdate system tray icon

Hdate applet:

Hdate Applet is a gnome 2 panel applet that show the hebrew date. Hdate Applet include the hcal-gtk desktop calendar.

hdate applet

Site by:

SourceForge Logo