{"id":241,"date":"2009-11-21T23:52:50","date_gmt":"2009-11-22T04:52:50","guid":{"rendered":"http:\/\/www.kosherjava.com\/?p=241"},"modified":"2025-08-27T12:37:34","modified_gmt":"2025-08-27T16:37:34","slug":"zmanimcli-command-line-interface","status":"publish","type":"post","link":"https:\/\/kosherjava.com\/2009\/11\/21\/zmanimcli-command-line-interface\/","title":{"rendered":"ZmanimCLI (Command Line Interface)"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/java-logo-660x386.jpg\" alt=\"Java Logo Sepia\" width=\"660\" height=\"386\" class=\"aligncenter size-large wp-image-5416\" data-wp-pid=\"5416\" srcset=\"https:\/\/kosherjava.com\/wp-content\/uploads\/java-logo-660x386.jpg 660w, https:\/\/kosherjava.com\/wp-content\/uploads\/java-logo-300x175.jpg 300w, https:\/\/kosherjava.com\/wp-content\/uploads\/java-logo-768x449.jpg 768w, https:\/\/kosherjava.com\/wp-content\/uploads\/java-logo.jpg 1024w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/>Moshe Wagner who wrote the <a href=\"\/2009\/03\/14\/zmanim-gui-released\/\">Zmanim GUI<\/a> notified me in August that that he created a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Command-line_interface\">command line interface<\/a> for zmanim using my <a href=\"\/zmanim-project\/\">Zmanim API<\/a>. The technical approach of using reflection was similar to the way I used reflection in the <s>Zmanim Clock Applet<\/s>, but he took it to new heights. Sample use of accessing zmanim using his CLI interface is:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">moshe@debian:~\/Desktop$ java -jar ZmanimCLI.jar sunrise\r\n6:10:28<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">moshe@debian:~\/Desktop$ java -jar ZmanimCLI.jar --date 2010\/08\/12 tzais72\r\n20:38:15<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">moshe@debian:~\/Desktop$ java -jar ZmanimCLI.jar\r\nUsage: ZmanimCLI &#x5B;options] &#x5B;Time]\r\n\r\nOptions:\r\n       -d      --date &amp;lt;yyyy\/mm\/dd&amp;gt;             Set date. (Year first!)\r\n       -lat    --latitude &amp;lt;latitude&amp;gt;           Set location&amp;#039;s latitude\r\n       -lon    --longitude &amp;lt;longitude&amp;gt;         Set location&amp;#039;s longitude\r\n       -e      --elevation &amp;lt;elevation&amp;gt;         Set location&amp;#039;s\r\nelevation; Positive only\r\n       -tz     --timezone &amp;lt;timezone&amp;gt;           Set location&amp;#039;s TimeZone\r\n\r\nHelp:\r\n       -h      --help                          Show this help\r\n       -stl    --time-list                     Show common available\r\ntimes to display\r\n       -ftl    --full-time-list                Show all available\r\ntimes to display\r\n       -tzl    --timezone-list                 Show available timezones\r\n\r\nExample:\r\n       ZmanimCLI --latitude 31.7780 --longitude 35.235149 --elevation\r\n600 --timezone Israel Sunrise\r\n       Will show the sunrise time today in Jerusalem<\/pre>\n<p>While your first reaction may be that it is interesting in a theoretical geeky way, but has no practical value, I will quote Moshe&#8217;s explanation as to why it is useful: <\/p>\n<blockquote><p>Why is this useful? Well, first of all it was a nice experiment. But mainly, you can now use Zmanim (although externally), via any language you want, no longer being tied to Java.<\/p><\/blockquote>\n<p> Months later, Moshe actually put this to practical use in his C++ based <a href=\"https:\/\/github.com\/moshewagner\/luach\">Luach<\/a> project. This Luach (similar to the known <a href=\"https:\/\/web.archive.org\/web\/20151031073051\/http:\/\/kaluach.com\/\">Kaluach<\/a>) uses the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Qt_%28toolkit%29\">Qt<\/a> framework. utilizing <a href=\"https:\/\/sourceforge.net\/p\/libhdate\/wiki\/Home\/\">libhdate<\/a> for the date stuff (something not offered by the Zmanim API, and the topic of a future <a href=\"\/tag\/faq\/\">Zmanim API FAQ<\/a>), displaying zmanim using the Zmanim API via CLI for the zmanim calculations. While you would expect such an approach to be slow, using the Luach seemed almost instantaneous. I will post more about his Luach program (recently reviewed at <a href=\"https:\/\/comapp.mobi\/\">KosherDev.com<\/a>) at some point in the future.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Moshe Wagner who wrote the Zmanim GUI notified me in August that that he created a command line interface for zmanim using my Zmanim API. The technical approach of using reflection was similar to the way I used reflection in the Zmanim Clock Applet, but he took it to new heights. Sample use of accessing &hellip; <a href=\"https:\/\/kosherjava.com\/2009\/11\/21\/zmanimcli-command-line-interface\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">ZmanimCLI (Command Line Interface)<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4,2],"tags":[27,39,32,24,75,74,55],"class_list":["post-241","post","type-post","status-publish","format-standard","hentry","category-software-dev","category-zmanim","tag-api","tag-cross-platform","tag-hebrew-date","tag-open-source","tag-software-dev","tag-zmanim","tag-zmanim-api"],"_links":{"self":[{"href":"https:\/\/kosherjava.com\/wp-json\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kosherjava.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kosherjava.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kosherjava.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kosherjava.com\/wp-json\/wp\/v2\/comments?post=241"}],"version-history":[{"count":3,"href":"https:\/\/kosherjava.com\/wp-json\/wp\/v2\/posts\/241\/revisions"}],"predecessor-version":[{"id":6650,"href":"https:\/\/kosherjava.com\/wp-json\/wp\/v2\/posts\/241\/revisions\/6650"}],"wp:attachment":[{"href":"https:\/\/kosherjava.com\/wp-json\/wp\/v2\/media?parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kosherjava.com\/wp-json\/wp\/v2\/categories?post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kosherjava.com\/wp-json\/wp\/v2\/tags?post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}