<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.sharpfin.org/index.php?action=history&amp;feed=atom&amp;title=ALMHX_AlarmClockTime</id>
	<title>ALMHX AlarmClockTime - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.sharpfin.org/index.php?action=history&amp;feed=atom&amp;title=ALMHX_AlarmClockTime"/>
	<link rel="alternate" type="text/html" href="https://www.sharpfin.org/index.php?title=ALMHX_AlarmClockTime&amp;action=history"/>
	<updated>2026-04-23T13:11:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.4</generator>
	<entry>
		<id>https://www.sharpfin.org/index.php?title=ALMHX_AlarmClockTime&amp;diff=218&amp;oldid=prev</id>
		<title>Philipp at 13:04, 8 June 2025</title>
		<link rel="alternate" type="text/html" href="https://www.sharpfin.org/index.php?title=ALMHX_AlarmClockTime&amp;diff=218&amp;oldid=prev"/>
		<updated>2025-06-08T13:04:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:04, 8 June 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l34&quot;&gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Be aware that the radio ignores timezones, and actually adjusts GMT when the clocks move on/back - consequently, the cccccc value is the local time, and is not GMT as would normally be expected.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Be aware that the radio ignores timezones, and actually adjusts GMT when the clocks move on/back - consequently, the cccccc value is the local time, and is not GMT as would normally be expected.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   #include &amp;lt;stdio.h&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   #include &amp;lt;stdio.h&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   #include &amp;lt;sys/time.h&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   #include &amp;lt;sys/time.h&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l48&quot;&gt;Line 48:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 48:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         printf(&amp;quot;%s&amp;quot;,ctime(&amp;amp;t));&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         printf(&amp;quot;%s&amp;quot;,ctime(&amp;amp;t));&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   }&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The above function returns the following, when supplied with 1209712500:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The above function returns the following, when supplied with 1209712500:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key hefvobmy_Sql579266_1:diff:1.41:old-17:rev-218:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Philipp</name></author>
	</entry>
	<entry>
		<id>https://www.sharpfin.org/index.php?title=ALMHX_AlarmClockTime&amp;diff=17&amp;oldid=prev</id>
		<title>Philipp: Created page with &quot;= ALMHX_AlarmClockTime.txt =  == File Format ==  The file contains a number of rows (one for each alarm).  Rows are in the format:   hh:mm t cccccccccc w a o  * hh - Hours to display for alarm time * mm - Minutes to display for alarm time * d  - Day of week (0=Sunday, 1=Monday) * cc - Unix time for alarm time (assumes always on GMT!) * w  - 0=Once, 2=Daily, 3=Weekly, 4=WeekDays, 5=Weekends  * a  - 0=Buzzer, 1=presetAlarm.txt, 2=presetAlarm1.txt ... * o  - 0=off, 1=on  Ex...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.sharpfin.org/index.php?title=ALMHX_AlarmClockTime&amp;diff=17&amp;oldid=prev"/>
		<updated>2025-06-08T09:18:55Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= ALMHX_AlarmClockTime.txt =  == File Format ==  The file contains a number of rows (one for each alarm).  Rows are in the format:   hh:mm t cccccccccc w a o  * hh - Hours to display for alarm time * mm - Minutes to display for alarm time * d  - Day of week (0=Sunday, 1=Monday) * cc - Unix time for alarm time (assumes always on GMT!) * w  - 0=Once, 2=Daily, 3=Weekly, 4=WeekDays, 5=Weekends  * a  - 0=Buzzer, 1=presetAlarm.txt, 2=presetAlarm1.txt ... * o  - 0=off, 1=on  Ex...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= ALMHX_AlarmClockTime.txt =&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
The file contains a number of rows (one for each alarm).  Rows are in the format:&lt;br /&gt;
&lt;br /&gt;
 hh:mm t cccccccccc w a o&lt;br /&gt;
&lt;br /&gt;
* hh - Hours to display for alarm time&lt;br /&gt;
* mm - Minutes to display for alarm time&lt;br /&gt;
* d  - Day of week (0=Sunday, 1=Monday)&lt;br /&gt;
* cc - Unix time for alarm time (assumes always on GMT!)&lt;br /&gt;
* w  - 0=Once, 2=Daily, 3=Weekly, 4=WeekDays, 5=Weekends &lt;br /&gt;
* a  - 0=Buzzer, 1=presetAlarm.txt, 2=presetAlarm1.txt ...&lt;br /&gt;
* o  - 0=off, 1=on&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
 07:15 5 1209712500 4 1 1&lt;br /&gt;
&lt;br /&gt;
Alarm On and set for 07:15, at Midnight on Sunday/Monday, Alarm Once, and use Buzzer.&lt;br /&gt;
&lt;br /&gt;
== Direct Manipulation of File ==&lt;br /&gt;
&lt;br /&gt;
If this file is edited outside of the ir application (e.g. directly from a webserver), the ir application ignores the changes.&lt;br /&gt;
&lt;br /&gt;
Following an external update, the ir application must be restarted, either by a radio reboot, or by using &amp;quot;init 3 ; init 2&amp;quot; in a script.&lt;br /&gt;
&lt;br /&gt;
== Calculating cccccccccccc ==&lt;br /&gt;
&lt;br /&gt;
The radio uses and maintains this number to work out the actual alarm time, so it must be correctly calculated each time it is changed / updated.  This means that we need to know the current time.&lt;br /&gt;
&lt;br /&gt;
The ir application performs its own time management, and the operating system time is left back in the 1970s.  There is no rdate program compiled into the OS.&lt;br /&gt;
&lt;br /&gt;
Be aware that the radio ignores timezones, and actually adjusts GMT when the clocks move on/back - consequently, the cccccc value is the local time, and is not GMT as would normally be expected.&lt;br /&gt;
  &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
  #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
  #include &amp;lt;sys/time.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  main(int argc, char *argv[]) {&lt;br /&gt;
         time_t t ;&lt;br /&gt;
         if (argc!=2) {&lt;br /&gt;
                 printf(&amp;quot;ctime cccccccc&lt;br /&gt;
&amp;quot;) ;&lt;br /&gt;
                 exit(1) ;&lt;br /&gt;
         } &lt;br /&gt;
        t=atoi(argv[1]) ;&lt;br /&gt;
        printf(&amp;quot;%s&amp;quot;,ctime(&amp;amp;t));&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The above function returns the following, when supplied with 1209712500:&lt;br /&gt;
&lt;br /&gt;
On the Radio: Fri May  2 07:15:00 2008&lt;br /&gt;
Under Cygwin: Fri May  2 08:15:00 2008&lt;br /&gt;
&lt;br /&gt;
== Writing a web-based Alarm management page ==&lt;br /&gt;
&lt;br /&gt;
In order to write a web-based Alarm manager script, the following tools are needed:&lt;br /&gt;
&lt;br /&gt;
* Get correct network time (rdate type program)&lt;br /&gt;
* Convert hh:mm to a real unix time (undoing timezone adjustments done by the ir application)&lt;br /&gt;
* Identify the current day (0=Sunday ...)&lt;br /&gt;
&lt;br /&gt;
Alternatively, a web-based Alarm manager application could be written instead of a script.  In this case, some steps shouldbe avoided to prevent repeated ntp requests (perhaps by managing the synchronisation of the unix clock)&lt;/div&gt;</summary>
		<author><name>Philipp</name></author>
	</entry>
</feed>